#include #include #include int main() { //std::ifstream inf("Text.txt"); std::cin.rdbuf(inf.rdbuf()); int A, B; std::cin >> A >> B; if (B - A == 1) { std::cout << "YES" << std::endl; } else { std::cout << "NO" << std::endl; } if (A < B) { std::cout << B - A - 1 << std::endl; } else if (A > B) { std::cout << A - B + 1 << std::endl; } else { std::cout << '1' << std::endl; } return 0; }