#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int a[n];
  int i, j;
  for (i = 0; i < n; i++) cin >> a[i];
  vector<pair<int, int> > l;
  for (i = 0; i < n - 1; i++) {
    if (a[i] < a[i + 1]) {
      l.push_back(make_pair(a[i + 1], a[i]));
    } else {
      l.push_back(make_pair(a[i], a[i + 1]));
    }
  }
  for (i = 0; i < n - 1; i++) {
    for (j = 0; j < n - 1; j++) {
      if (l[i].second < l[j].second && l[j].second < l[i].first &&
          l[i].first < l[j].second) {
        cout << "yes";
        return 0;
      } else if (l[j].second < l[i].second && l[i].second < l[j].first &&
                 l[j].first < l[i].first) {
        cout << "yes";
        return 0;
      }
    }
  }
  cout << "no";
  return 0;
}
