m, f = map(int, input().split()) if m < f: print("YES\n{}".format(f-(m+1))) elif m == f: print("NO\n1") else: print("NO\n{}".format((m+1)-f))