#include #include using namespace std; int main(){ int d[7]; bool f = false; for(int i = 0;i < 7;i++) cin >> d[i]; sort(d,d + 7); do{ bool flag = true; for(int i = 0;i < 5;i++) if(!(d[i] != d[i + 1] && d[i + 1] != d[i + 2] && d[i] != d[i + 2] && !(d[i] < d[i + 1] && d[i + 1] < d[i + 2]) && d[i] < d[i + 2])) flag = false; if(flag){ f = true; break; } }while(next_permutation(d,d + 7)); cout << (f ? "YES" : "NO") << endl; }