first = input() numStr = first.split() numStr[0] = int(numStr[0]) numStr[1] = int(numStr[1]) if numStr[0] + 1 - numStr[1] > 0 : print("NO") print(abs(numStr[0] + 1 - numStr[1])) else : print("YES") print(abs(numStr[0] + 1 - numStr[1]))