#include using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(),(v).end() template inline bool chmax(A &a, B b) { if (a inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; } typedef unsigned long long ull; typedef long long ll; typedef pair pii; typedef pair pll; typedef pair P; const ll INF = 1ll<<29; const ll MOD = 1000000007; const double EPS = 1e-10; int main() { int dx[8] = {-2, -2, -1, -1, 1, 1, 2, 2}; int dy[8] = {-1, 1, -2, 2, -2, 2, -1, 1}; queue

que; que.push(P(0, pii(0, 0))); set ss; while (!que.empty()) { P now = que.front(); que.pop(); if (now.first > 3) continue; ss.insert(now.second); int x = now.second.first; int y = now.second.second; REP(i, 8) que.push(P(now.first + 1, pii(x + dx[i], y + dy[i]))); } int x, y; cin >> x >> y; if (ss.find(pii(x, y)) != ss.end()) puts("YES"); else puts("NO"); return 0; }