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