str=input() a,b=str.split() a=int(a) b=int(b) if (abs(a)>abs(b)): if(a%b==0):print(int(a/b)) else:print('NO') else: if(b%a==0):print(int(b/a)) else:print('NO')