// yukicodr //No.240 //二次元可変配列 //vector > mass; //vector > memo; //vector memo; //#include "stdafx.h" #include #include #include //list #include //queue #include //tree #include //連想配列 #include //hash #include //hash #include #include #include //#include using namespace std; #define FOR(x,to) for(x=0;x(b)?(a):(b)) #define FMIN(a,b) ((a)<(b)?(a):(b)) #define FCEIL(a,b) ((a)+(b)-1)/(b) typedef unsigned long long ULL; typedef signed long long SLL; //昇順 int compare_up(const int * a, const int *b) { if (*a > *b) return (1); else if (*a < *b) return (-1); return (0); } //降順 int compare_down(const int * a, const int *b) { if (*a > *b) return (-1); else if (*a < *b) return (1); return (0); } int solve(int i, ULL index_flag) { return 0; } SLL dx[8] = { -2,-2,-1,-1, 1, 1, 2, 2 }; SLL dy[8] = { -1, 1,-2, 2,-2, 2,-1, 1 }; SLL X, Y; typedef struct COORD { SLL x; SLL y; }COORD; queue _queue; COORD a; SLL ban[25][25]; int main() { SLL k = 0; cin >> X; cin >> Y; if (abs(X) >= 10 || abs(Y) >= 10) { cout << "NO" << endl; return 0; } a.x = 0; a.y = 0; ban[a.y + 10][a.x + 10] = 8; for (int j = 0; j <65; j++) { for (int i = 0; i < 8; i++) { COORD c; c.x =a.x+ dx[i]; c.y =a.y+ dy[i]; if(c.y ==0 && c.x == 0) ban[c.y + 10][c.x + 10] = 8; else ban[c.y + 10][c.x + 10] = 1; _queue.push(c); //キューに入れる } //先頭を見る a = _queue.front(); //先頭を取り除く _queue.pop(); } /* for (int y = 0;y<20;y++) { for (int x = 0; x < 20;x++) cout << ban[y][x]; cout << endl; } */ if (ban[Y+10][X+10]) cout << "YES" << endl; else cout << "NO" << endl; //getchar(); return 0; }