#include <bits/stdc++.h>
using namespace std;
const int maxn = 1111;
int x[maxn];
int main() {
  int n, x1, x2, x3, x4, i, j;
  bool flag = false;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &x[i]);
  }
  for (i = 0; i < n - 1; i++) {
    x1 = x[i], x2 = x[i + 1];
    if (x1 > x2) swap(x1, x2);
    for (j = i + 1; j < n - 1; j++) {
      x3 = x[j], x4 = x[j + 1];
      if (x3 > x4) swap(x3, x4);
      if (x1 < x3 && x3 < x2 && x2 < x4) {
        flag = true;
      }
      if (x3 < x1 && x1 < x4 && x4 < x2) {
        flag = true;
      }
    }
  }
  if (flag)
    cout << "yes" << endl;
  else
    cout << "no" << endl;
}
