n = input() m = n.split() p = [int(i) for i in m] if p[0] < p[1]: print("YES") print(p[1] - p[0] - 1) else: print("NO") print(p[0] - p[1] + 1)