#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x[1000], f = 1;
  int mx, mn;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x[i]);
    if (i >= 2 && f) {
      for (int j = 1; j < i; j++) {
        if (x[j] > x[j - 1]) {
          mx = j;
          mn = j - 1;
        } else {
          mx = j - 1;
          mn = j;
        }
        if ((x[i] > x[mn] && x[i] < x[mx]) &&
            (x[i - 1] < x[mn] || x[i - 1] > x[mx])) {
          f = 0;
        } else if ((x[i - 1] > x[mn] && x[i - 1] < x[mx]) &&
                   (x[i] < x[mn] || x[i] > x[mx])) {
          f = 0;
        }
      }
    }
  }
  if (f == 1) {
    printf("no");
  } else {
    printf("yes");
  }
  return 0;
}
