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