#include #include using namespace std; int main() { int x, y; int dx[9] = { 0, 1, 2, 2, 1, -1, -2, -2, -1 }, dy[9] = { 0, 2, 1, -1, -2, -2, -1, 1, 2 }; typedef pair P; queue

que; cin >> x >> y; if (x < -6 || x > 6 || y < -6 || y > 6) { cout << "NO" << endl; return 0; } que.push(P(7, 7)); while (que.size()) { P p = que.front(); que.pop(); if (p.first == x + 7 && p.second == y + 7) { cout << "YES" << endl; return 0; } for (int i = 1; i < 9; i++) { int nx = p.first + dx[i]; int ny = p.second + dy[i]; que.push(P(nx, ny)); } } cout << "NO" << endl; }