boys,girls = map(int,input().split()) if boys % girls == 1 : print('YES') else: print('NO') print(abs(boys - girls))