import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines A,B = map(int,read().split()) if B > A: print('YES') print(B-1-A) else: print('NO') print(A+1-B)