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