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