#include using namespace std; int A, B; int main() { cin >> A >> B; int ret = 0; for(int i = -10009; i <= 10009; i++) { if(A * i == B) ret = i; } if(ret == 0) cout << "NO" << endl; else cout << ret << endl; return 0; }