#include <bits/stdc++.h>
using namespace std;
int n, m;
map<string, int> mpp;
vector<vector<pair<int, int> > > AdjList;
vector<int> visited;
priority_queue<pair<int, int> > pq;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  int temp;
  cin >> n;
  int a[10000];
  for (int i = 0; i < n; i++) cin >> a[i];
  bool q = true;
  for (int i = 0; i < n - 1; i++) {
    for (int j = 0; j < n - 1; j++) {
      if (max(a[i], a[i + 1]) < max(a[j], a[j + 1]) &&
          min(a[i], a[i + 1]) < min(a[j], a[j + 1]) &&
          max(a[i], a[i + 1]) > min(a[j], a[j + 1])) {
        cout << "yes" << endl;
        return 0;
      }
    }
  }
  cout << "no";
}
