fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6. int X1, Y1, X2, Y2;
  7. cin >> X1 >> Y1 >> X2 >> Y2;
  8. if(X1 == X2 and Y1 != 1){
  9. if(X1 == X2 and (abs(Y1 - Y2 == 2)) || X1 == X2 and Y1 + 1 == Y2){
  10.  
  11. }
  12. cout << "YES";
  13. }else{
  14. cout << "NO";
  15. }
  16. return 0;
  17. }
Success #stdin #stdout 0s 5312KB
stdin
5 2 
5 4
stdout
YES