#include <bits/stdc++.h>
using namespace std;
const int L = 1010;
struct semicircle {
  int a, b;
} b[L];
int a[L], n, flag;
void init(void) {
  cin >> n;
  int i;
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (i = 1; i < n; i++)
    b[i].a = min(a[i], a[i + 1]), b[i].b = max(a[i], a[i + 1]);
}
int pd(int a, int b, int c, int d) {
  if (a < b && b < c && c < d) return 1;
  return 0;
}
void work(void) {
  int i, j;
  for (i = 1; i < n; i++) {
    for (j = 1; j < n; j++)
      if (i != j && pd(b[i].a, b[j].a, b[i].b, b[j].b)) {
        flag = 1;
        break;
      }
    if (flag) break;
  }
  if (flag)
    printf("yes\n");
  else
    printf("no\n");
}
int main(void) {
  init();
  work();
  return 0;
}
