intstr=input() intstr_s = intstr.split(" ") boy_num = int(intstr_s[0]) lady_num = int(intstr_s[1]) if boy_num < lady_num: print("YES") print(int(lady_num-boy_num-1)) else: print("NO") print(int(boy_num-lady_num+1))