#include using namespace std; typedef long long int ll; typedef pair pll; #define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i)) #define REP(i, n) FOR(i, n, 0) #define OF64 std::setprecision(10) const ll MOD = 1000000007; const ll INF = (ll)1e15; int main() { ll A, B; cin >> A >> B; if (B - A >= 1) { cout << "YES" << endl; cout << B - A - 1 << endl; } else { cout << "NO" << endl; cout << A - B + 1 << endl; } return 0; }