#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double eps = 10e-9;
const int maxn = 1000 + 20;
int A[maxn];
void swap(int& a, int& b) {
  int c = a;
  a = b;
  b = c;
}
int main() {
  int n;
  scanf("%d", &(n));
  for (int i = 0; i < (n); i++) scanf("%d", &(A[i]));
  int ans = 0;
  int flag = 1;
  for (int i = 0; i < n - 1 && flag; i++) {
    int x1 = A[i];
    int y1 = A[i + 1];
    if (x1 > y1) swap(x1, y1);
    for (int j = i + 1; j < n - 1; j++) {
      int x2 = A[j];
      int y2 = A[j + 1];
      if (x2 > y2) swap(x2, y2);
      if ((x1 < x2 && x2 < y1 && y1 < y2) || (x2 < x1 && x1 < y2 && y2 < y1)) {
        ans = 1;
        flag = 0;
        break;
      }
    }
  }
  if (ans)
    printf("yes\n");
  else
    printf("no\n");
  return 0;
}
