#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair pi; typedef pair pl; typedef pair pls; int dx[8] = { -2,-2,-1,-1,1,1,2,2 }; int dy[8] = {-1,1,-2,2,-2,2,-1,1}; queue,ll>> q; int main() { ll X, Y; cin >> X >> Y; q.push({{ 0, 0 }, 0}); while (!q.empty()) { ll x = q.front().first.first; ll y = q.front().first.second; ll n = q.front().second; q.pop(); for (int i = 0; i < 8; i++) { ll ddx = x + dx[i], ddy = y + dy[i]; if (n < 3 && ddx == X && ddy == Y) { cout << "YES" << endl; return 0; } if (n < 3) q.push({ {ddx,ddy},n + 1 }); } } cout << "NO" << endl; return 0; }