#include "bits/stdc++.h" using namespace std; #define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i)) #define rep(i,j) FOR(i,0,j) #define each(x,y) for(auto &(x):(y)) #define mp make_pair #define all(x) (x).begin(),(x).end() #define debug(x) cout<<#x<<": "<<(x)< pii; typedef vector vi; typedef vector vll; int D[7]; int main(){ while(cin >> D[0]){ rep(i, 6)cin >> D[i + 1]; sort(D, D + 7); int ok = 0; do{ ok = 1; rep(i, 5){ if(D[i] >= D[i + 2] || D[i] == D[i + 1] || D[i + 1] == D[i + 2] || (max({D[i],D[i + 1],D[i + 2]}) != D[i + 1] && min({D[i], D[i + 1], D[i + 2]}) != D[i + 1])) ok = 0; } if(ok)break; } while(next_permutation(D, D + 7)); puts(ok ? "YES" : "NO"); } }