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