a,b=map(int,input().split()) print('NO' if a>=b else 'YES') print(0 if a+1-b==0 else abs(a+1-b))