#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int p1;
  cin >> p1;
  int p2;
  cin >> p2;
  vector<pair<int, int> > v;
  int p = p2;
  v.push_back(make_pair(p1, p2));
  for (int i = 1; i < n; i++) {
    int t;
    cin >> t;
    for (int i = 0; i < v.size(); i++) {
      int l1 = v[i].first;
      int l2 = v[i].second;
      if (l1 > l2 & t<l1 & t> l2 & (p > l1 | p < l2)) {
        cout << "yes";
        return 0;
      } else if (l2 > l1 & t<l2 & t> l1 & (p<l1 | p> l2)) {
        cout << "yes";
        return 0;
      } else if (l1 > l2 & (t<l2 | t> l1) & p<l1 & p> l2) {
        cout << "yes";
        return 0;
      } else if (l2 > l1 & (t > l2 | t < l1) & p > l1 & p < l2) {
        cout << "yes";
        return 0;
      }
    }
    v.push_back(make_pair(p, t));
    p = t;
  }
  cout << "no";
}
