#include using namespace std; int main() { int people[2]; cin >> people[0] >> people[1]; if (people[0]+1 == people[1]) { cout << "YES" << endl; cout << 0 << endl; } else if (people[0]+1 > people[1]) { cout << "NO" << endl; cout << people[0]+1 - people[1] << endl; } else if (people[0]+1 < people[1]) { cout << "YES" << endl; cout << people[1] - (people[0]+1) << endl; } return 0; }