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