#include <bits/stdc++.h>
using namespace std;
int xs[1000];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    cin >> xs[i];
  }
  bool ok = 1;
  for (int i = 0; i < n - 1; ++i) {
    int st = min(xs[i], xs[i + 1]);
    int ed = max(xs[i], xs[i + 1]);
    for (int j = 0; j < n - 1; ++j) {
      if (i != j) {
        int st1 = min(xs[j], xs[j + 1]);
        int ed1 = max(xs[j], xs[j + 1]);
        if ((st1 > st && st1 < ed && ed1 > ed) ||
            (ed1 > st && ed1 < ed && st1 < st)) {
          ok = 0;
          break;
        }
      }
    }
    if (!ok) break;
  }
  if (ok)
    cout << "no" << endl;
  else
    cout << "yes" << endl;
}
