#include "bits/stdc++.h" #define REP(i,n,N) for(ll i=(n); i<(N); i++) #define RREP(i,n,N) for(ll i=(N-1); i>=n; i--) #define CK(n,a,b) ((a)<=(n)&&(n)<(b)) #define ALL(v) (v).begin(),(v).end() #define p(s) cout<<(s)<> typedef long long ll; using namespace std; const int INF = 1e9; const int MOD = 1e9+7; const ll LLINF = 1e18; int main(){ vector D; REP(i,0,7){ int d; cin>>d; D.push_back(d); } sort(ALL(D)); string ans="NO"; do{ bool ok=true; REP(i,0,5){ if(D[i]==D[i+1]||D[i+1]==D[i+2]||D[i]==D[i+2]) ok=false; if((D[i]>D[i+1]&&D[i+1]>D[i+2])||D[i]>D[i+2]) ok=false; } if(ok){ ans="YES"; break; } }while(next_permutation(ALL(D))); p(ans); return 0; }