A, B = [int(i) for i in input().split()] if B-A <= 0: ans = "NO" count = A-B+1 else: ans = "YES" count = B-A-1 print(ans) print(count)