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