#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double EPS = 1e-9;
const int INF = 0x5ffffff;
const int N = 100 * 1000 + 10;
int n;
int a[N];
bool okay(int x, int y) {
  int la = a[x - 1], ra = a[x];
  if (la > ra) {
    swap(la, ra);
  }
  int lb = a[y - 1], rb = a[y];
  if (lb > rb) {
    swap(lb, rb);
  }
  return (la < lb && ra > lb && ra < rb) || (lb < la && rb > la && rb < ra);
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  bool yes = false;
  for (int i = 1; i < n && !yes; i++) {
    for (int j = i + 1; j < n && !yes; j++) {
      if (okay(i, j)) {
        yes = true;
        break;
      }
    }
  }
  yes ? cout << "yes" << endl : cout << "no" << endl;
  return 0;
}
