A, B = map(int, input().split()) if B >= A: s = B - A if s >= 1: print("YES") print(s - 1) else: print("NO") print(1) else: print("NO") print((A - B) + 1)