#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  long long int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  if (n == 1)
    cout << "no" << endl;
  else if (n > 1) {
    vector<pair<long long int, long long int>> vp;
    for (int i = 0; i < n - 1; i++)
      vp.push_back({min(arr[i], arr[i + 1]), max(arr[i], arr[i + 1])});
    bool exist = true;
    for (int i = 0; i < vp.size() - 1; i++) {
      for (int j = i + 1; j < vp.size(); j++) {
        long long int one1 = vp[i].first, two1 = vp[i].second;
        long long int one2 = vp[j].first, two2 = vp[j].second;
        if (one1 < one2 && one2 < two1 && two1 < two2) exist = false;
        if (one2 < one1 && one1 < two2 && two2 < two1) exist = false;
      }
    }
    cout << (!exist ? "yes" : "no") << endl;
  }
  return 0;
}
