#include using namespace std; const string msg[] = { "NO", "YES" }; int kado( int x, int y, int z ){ if( x == y or y == z or z == x ) return 0; if( not ( min( { x, y, z } ) == y or max( { x, y, z } ) == y ) ) return 0; return x < z; } signed main(){ vector< int > D( 7 ); for( int i = 0; i < 7; ++i ) cin >> D[ i ]; sort( D.begin(), D.end() ); do{ int ng = 0; for( int i = 0; i + 3 <= 7; ++i ) ng |= not kado( D[ i ], D[ i + 1 ], D[ i + 2 ] ); if( not ng ) cout << msg[ 1 ] << endl, exit( 0 ); } while( next_permutation( D.begin(), D.end() ) ); cout << msg[ 0 ] << endl; return 0; }