n = input() m = n.split() a = int(m[0]) b = int(m[1]) if a + 1 <= b: print('YES') print(str(b-a-1)) else: print('NO') print(str(a+1-b))