#include #include #include using namespace std; bool is_kadomatsu(int a,int b,int c){ if(a==b || a==c || b==c)return false; if(ab && c>b) ))return true; return false; } int main(){ vector A(7); for(int i = 0; 7 > i; i++)cin>>A[i]; sort(A.begin(),A.end()); do{ bool ok = true; for(int i = 0; 5 > i; i++){ if(!is_kadomatsu(A[i],A[i+1],A[i+2])){ ok = false; break; } } if(ok){ cout << "YES" << endl; return 0; } }while(next_permutation(A.begin(),A.end())); cout << "NO" << endl; }