#include <bits/stdc++.h>
using namespace std;
bool fun(int a, int b, int c, int d) {
  if ((a < c && c < b && b < d) || (c < a && a < d && d < b)) return true;
  return false;
}
int main() {
  std::ios::sync_with_stdio(false);
  int n, x = 0;
  cin >> n;
  bool k = false;
  int second[n];
  for (int i = 0; i < n; i++) {
    cin >> second[i];
  }
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n - 1; j++) {
      int a, b, c, d;
      a = min(second[i], second[i + 1]);
      b = max(second[i], second[i + 1]);
      c = min(second[j], second[j + 1]);
      d = max(second[j], second[j + 1]);
      if (fun(a, b, c, d)) k = true;
    }
  }
  if (k)
    cout << "yes";
  else
    cout << "no";
  return 0;
}
