#include using namespace std; #define REP(i,n) for(int i=0; i<(int)(n); i++) bool check(int x, int y, int z) { if (x == y || y == z || z == x) return false; if (y != max({x, y, z}) && y != min({x, y, z})) return false; return x < z; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); vector v(7); REP (i, 7) cin >> v[i]; sort(v.begin(), v.end()); bool ret = false; do { bool ck = true; for (int i = 0; i + 2 < 7; i++) ck &= check(v[i], v[i+1], v[i+2]); ret |= ck; } while (next_permutation(v.begin(), v.end())); if (ret) cout << "YES" << endl; else cout << "NO" << endl; return 0; }