#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, num[1010], x1, x2, x3, x4;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &num[i]);
  for (i = 0; i + 1 < n; i++) {
    if (num[i] < num[i + 1]) {
      x1 = num[i];
      x2 = num[i + 1];
    } else {
      x1 = num[i + 1];
      x2 = num[i];
    }
    for (int j = i + 2; j + 1 < n; j++) {
      if (num[j] < num[j + 1]) {
        x3 = num[j];
        x4 = num[j + 1];
      } else {
        x3 = num[j + 1];
        x4 = num[j];
      }
      if ((x3 < x1 && x1 < x4 && x4 < x2) || (x3 < x2 && x2 < x4 && x1 < x3)) {
        printf("yes");
        return 0;
      }
    }
  }
  printf("no");
  return 0;
}
