#include<iostream> using namespace std; int n, m;; int zz(int a, int b) { return b==0 ? a: zz(b, a%b); } int main() { while (cin >> n >> m&&n != -1 && m != -1) cout << (nb(n, m) == 1 ? "YES" : "POOR Haha") << endl; }