a,b = map(int,input().split()) if (a % 2 != 0 and b % 2 == 0) and (a + 1) == b: print('YES') print(0) else: print(abs(a-b) + 1)