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