fork(1) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int x,y;
  6. cin >> x >> y;
  7. if(x<y)
  8. {
  9. int t = y-x;
  10. if(t<=2)
  11. {
  12. cout << "Yes" << endl;
  13. }
  14. else cout << "No" << endl;
  15. }
  16. else
  17. {
  18. int n = x-y;
  19. if(n<=3)
  20. {
  21. cout << "Yes" << endl;
  22. }
  23. else cout << "No" << endl;
  24. }
  25. return 0;
  26. }
Success #stdin #stdout 0s 5316KB
stdin
1 4
stdout
No