#include // clang-format off using namespace std; using ll=long long; using ull=unsigned long long; using pll=pair; const ll INF=4e18; void print0(){}; template void print0(H h,T... t){cout<void print(H h,T... t){print0(h);if(sizeof...(T)>0)print0(" ");print(t...);} void perr0(){}; template void perr0(H h,T... t){cerr<void perr(H h,T... t){perr0(h);if(sizeof...(T)>0)perr0(" ");perr(t...);} void ioinit() { cout<& A) { if (A.size() == 0) { return; } ll n = A.size(); ll k = randint(0, n - 1); ll base = A[k]; vector large; vector small; for (ll i = 0; i < n - 1; i++) { if (i == k) continue; if (gt(base, A[i])) { large.push_back(A[i]); } else if (gt(A[i], base)) { small.push_back(A[i]); } else { print("No"); exit(0); } } myqsort(large); myqsort(small); } int main() { ioinit(); ll N; cin >> N >> X; vector A(N); for (ll i = 0; i < N; i++) { cin >> A[i]; } myqsort(A); print("Yes"); return 0; }