def solve(): line = input().split(" ") male = int(line[0]) female = int(line[1]) remain = 0 if (male + 1 > female): print("NO") remain = male + 1 - female elif (male + 1 == female): print("YES") else: print("YES") remain = female - (male + 1) print(remain) solve()