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