#include <bits/stdc++.h>
using namespace std;
int n, x, i;
pair<int, int> p[1001];
int main() {
  cin >> n;
  cin >> x;
  p[i].first = x;
  for (; i < n - 2; i++) {
    cin >> x;
    p[i].second = x;
    p[i + 1].first = x;
  }
  cin >> x;
  p[i].second = x;
  for (int j = 0; j < n; j++) {
    if (p[j].first > p[j].second) swap(p[j].first, p[j].second);
    for (int k = j; k < n; k++) {
      if (p[k].first > p[k].second) swap(p[k].first, p[k].second);
      if (((p[k].first > p[j].first && p[k].first < p[j].second) &&
           (p[k].second < p[j].first || p[k].second > p[j].second)) ||
          ((p[j].first > p[k].first && p[j].first < p[k].second) &&
           (p[j].second < p[k].first || p[j].second > p[k].second))) {
        cout << "yes\n";
        return 0;
      }
    }
  }
  cout << "no" << endl;
  return 0;
}
