#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
int t; cin >> t;
while(t--)
{
int n, m; cin >> n >> m;
if(n == 0 && m % 2)
cout << "NO";
else if(n % 2 && m == 0)
cout << "NO";
else if(n % 2 == 0)
cout << "YES";
else
cout << "NO";
cout << "\n";
}
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNkZWZpbmUgbGwgbG9uZyBsb25nCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgoKaW50IG1haW4oKQp7CiAgICBpbnQgdDsgY2luID4+IHQ7IAogICAgd2hpbGUodC0tKQogICAgewogICAgICAgIGludCBuLCBtOyBjaW4gPj4gbiA+PiBtOyAKICAgICAgICBpZihuID09IDAgJiYgbSAlIDIpCiAgICAgICAgICAgIGNvdXQgPDwgIk5PIjsgCiAgICAgICAgZWxzZSBpZihuICUgMiAmJiBtID09IDApCiAgICAgICAgICAgIGNvdXQgPDwgIk5PIjsgCiAgICAgICAgZWxzZSBpZihuICUgMiA9PSAwKQogICAgICAgICAgICBjb3V0IDw8ICJZRVMiOwogICAgICAgIGVsc2UgCiAgICAgICAgICAgIGNvdXQgPDwgIk5PIjsgCiAgICAgICAgY291dCA8PCAiXG4iOwogICAgfQp9Cg==