#include using namespace std; using ll = long long; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b &A){ ll L = A.size(); FOR(i, 0, L-2){ if(!is_kadomatsu(A[i], A[i+1], A[i+2])) return false; if(A[i]>=A[i+2]) return false; } return true; } int main(){ cin.tie(0); ios::sync_with_stdio(false); // input vector A(7); FOR(i, 0, 7){ cin >> A.at(i); } sort(ALL(A)); do{ if(check(A)){ p_yes(); return 0; } }while(next_permutation(ALL(A))); p_no(); return 0; }