n = input() n = n.split() d = int(n[0]) j = int(n[1]) if d > j or d == j: print("NO") print((d + 1) - j) elif d < j: print("YES") print(j - (d + 1))