#include #include #include #define S q.front().first #define T q.front().second using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int dist[13][13], i, j, X, Y; queue> q; const int di[] = { -2, -2, -1, -1, 1, 1, 2, 2 }, dj[] = { -1, 1, -2, 2, -2, 2, -1, 1 }; cin >> X >> Y; if (abs(X) > 6 || abs(Y) > 6) { cout << "NO\n"; return 0; } for (i = 0; i != 13; ++i) for (j = 0; j != 13; ++j) dist[i][j] = -1; dist[6][6] = 0; q.emplace(6, 6); while (!q.empty() && dist[S][T] < 3) { for (i = 0; i != 8; ++i) if (dist[S + di[i]][T + dj[i]] == -1) dist[S + di[i]][T + dj[i]] = dist[S][T] + 1, q.emplace(S + di[i], T + dj[i]); q.pop(); } if (dist[X + 6][Y + 6] != -1) cout << "YES\n"; else cout << "NO\n"; return 0; }