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