a,b = map(int,input().split()) a_sum = a + 1 if a_sum == b: print('YES') print(0) else: print('NO') print(abs(a_sum - b))