Language: C++

#include <iostream>
using namespace std;

int main()
{
    int a,b,c,d,ans=0;
    cin>>a>>b>>c>>d;
    if(a==1){
        if(b==4){
            if((c==7&&d==9)||(c==9&&d==7){
                ans=1;
            }
        }
        if(b==7){
            if((c==4&&d==9)||(c==9&&d==4){
                ans=1;
            }
        }
        if(b==9){
            if((c==7&&d==4)||(c==4&&d==7){
                ans=1;
            }
        }
    }
    if(a==4){
        if(b==1){
            if((c==7&&d==9)||(c==9&&d==7){
                ans=1;
            }
        }
        if(b==7){
            if((c==1&&d==9)||(c==9&&d==1){
                ans=1;
            }
        }
        if(b==9){
            if((c==7&&d==1)||(c==1&&d==7){
                ans=1;
            }
        }
    }
    if(a==7){
        if(b==4){
            if((c==1&&d==9)||(c==9&&d==1){
                ans=1;
            }
        }
        if(b==1){
            if((c==4&&d==9)||(c==9&&d==4){
                ans=1;
            }
        }
        if(b==9){
            if((c==1&&d==4)||(c==4&&d==1){
                ans=1;
            }
        }
    }
    if(a==9){
        if(b==4){
            if((c==7&&d==1)||(c==1&&d==7){
                ans=1;
            }
        }
        if(b==7){
            if((c==4&&d==1)||(c==1&&d==4){
                ans=1;
            }
        }
        if(b==1){
            if((c==7&&d==4)||(c==4&&d==7){
                ans=1;
            }
        }
    }
    if(ans==1)cout<<"YES";
    else cout<<"NO";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:42: error: expected ')' before '{' token
   10 |             if((c==7&&d==9)||(c==9&&d==7){
      |               ~                          ^
      |                                          )
a.cc:13:9: error: expected primary-expression before '}' token
   13 |         }
      |         ^
a.cc:15:42: error: expected ')' before '{' token
   15 |             if((c==4&&d==9)||(c==9&&d==4){
      |               ~                          ^
      |                                          )
a.cc:18:9: error: expected primary-expression before '}' token
   18 |         }
      |         ^
a.cc:20:42: error: expected ')' before '{' token
   20 |             if((c==7&&d==4)||(c==4&&d==7){
      |               ~                          ^
      |                                          )
a.cc:23:9: error: expected primary-expression before '}' token
   23 |         }
      |         ^
a.cc:27:42: error: expected ')' before '{' token
   27 |             if((c==7&&d==9)||(c==9&&d==7){
      |               ~                          ^
      |                                          )
a.cc:30:9: error: expected primary-expression before '}' token
   30 |         }
      |         ^
a.cc:32:42: error: expected ')' before '{' token
   32 |             if((c==1&&d==9)||(c==9&&d==1){
      |               ~                          ^
      |                                          )
a.cc:35:9: error: expected primary-expression before '}' token
   35 |         }
      |         ^
a.cc:37:42: error: expected ')' before '{' token
   37 |             if((c==7&&d==1)||(c==1&&d==7){
      |               ~                          ^
      |                                          )
a.cc:40:9: error: expected primary-expression before '}' token
   40 |         }
      |         ^
a.cc:44:42: error: expected ')' before '{' token
   44 |             if((c==1&&d==9)||(c==9&&d==1){
      |               ~                          ^
      |                                          )
a.cc:47:9: error: expected primary-expression before '}' token
   47 |         }
      |         ^
a.cc:49:42: error: expected ')' before '{' token
   49 |             if((c==4&&d==9)||(c==9&&d==4){
      |               ~                          ^
      |                                          )
a.cc:52:9: error: expected primary-expression before '}' token
   52 |         }
      |         ^
a.cc:54:42: error: expected ')' before '{' token
   54 |             if((c==1&&d==4)||(c==4&&d==1){
      |               ~                          ^
      |                                          )
a.cc:57:9: error: expected primary-expression before '}' token
   57 |         }
      |         ^
a.cc:61:42: error: expected ')' before '{' token
   61 |             if((c==7&&d==1)||(c==1&&d==7){
      |               ~                          ^
      |                                          )
a.cc:64:9: error: expected primary-expression before '}' token
   64 |         }
      |         ^
a.cc:66:42: error: expected ')' before '{' token
   66 |             if((c==4&&d==1)||(c==1&&d==4){
      |               ~                          ^
      |                                          )
a.cc:69:9: error: expected primary-expression before '}' token
   69 |         }
      |         ^
a.cc:71:42: error: expected ')' before '{' token
   71 |             if((c==7&&d==4)||(c==4&&d==7){
      |               ~                          ^
      |                                          )
a.cc:74:9: error: expected primary-expression before '}' token
   74 |         }
      |         ^