#include using namespace std; int main(){ int A,B; cin >> A >> B; if(A + 1== B){ cout << "YES" << endl << 0 << endl; }else{ cout << "NO" << endl << abs(B-A-1) << endl; } }