bool kado(int a, int b, int c) { return ((ac)||(a>b&&b notks; rd(N); rd(A(N)); REP(i, N-2) { if (!kado(A[i], A[i+1], A[i+2])) { notks.push_back(i); } } REP(i, N) { for (auto k : notks) { if (tryk(i, k)) return true; } } return false; } { int T; rd(T); REP(i, T) { if (solve()) { wt("Yes"); } else { wt("No"); } } }