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