#include <bits/stdc++.h>
using namespace std;
struct ab {
  int a, b;
};
int Shalga(int x1, int y1, int x2, int y2) {
  if (x1 > y1) swap(x1, y1);
  if (x2 > y2) swap(x2, y2);
  if (x1 > x2) {
    swap(x1, x2);
    swap(y1, y2);
  }
  if (x2 > x1 && x2 < y1 && y1 < y2)
    return 1;
  else
    return -1;
}
int main() {
  int k, n, x, y;
  ab line[10001];
  k = 0;
  cin >> n;
  cin >> x;
  for (int i = 1; i < n; i++) {
    cin >> y;
    for (int j = 0; j < k; j++) {
      if (Shalga(x, y, line[j].a, line[j].b) == 1) {
        cout << "yes" << endl;
        return 0;
      }
    }
    line[k].a = x;
    line[k].b = y;
    k++;
    x = y;
  }
  cout << "no" << endl;
}
