#include #define ALL(v) std::begin(v),std::end(v) using lint=long long; using lubl=long double; int main(){ std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false); std::cout.setf(std::ios_base::fixed);std::cout.precision(15); lint n=7; std::vectora(n); for(lint&x:a)std::cin>>x; std::sort(ALL(a)); do{ for(lint i=0;i<=n-2;i++){ if(i==n-2){ std::cout<<"YES"<<'\n'; return 0; } if((a.at(i)-a.at(i+1))*(a.at(i+2)-a.at(i+1))<=0||a.at(i)>=a.at(i+2))break; } }while(std::next_permutation(ALL(a))); std::cout<<"NO"<<'\n'; }