#include <bits/stdc++.h>
using namespace std;
int N;
int A[1002];
bool inters;
int main() {
  cin >> N;
  for (int i = 1; i <= N; ++i) cin >> A[i];
  for (int i = 1; i <= N - 1; ++i)
    for (int j = 1; j <= N - 1; ++j) {
      int L1 = min(A[i], A[i + 1]), L2 = min(A[j], A[j + 1]);
      int R1 = max(A[i], A[i + 1]), R2 = max(A[j], A[j + 1]);
      if (L1 < L2 && L2 < R1 && R1 < R2) inters = true;
    }
  if (inters)
    cout << "yes\n";
  else
    cout << "no\n";
}
