#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  bool ans = false;
  for (int i = 0; i < n - 2; i++) {
    int x1 = min(v[i], v[i + 1]);
    int x2 = max(v[i], v[i + 1]);
    for (int j = i + 1; j < n - 1; j++) {
      int y1 = min(v[j], v[j + 1]);
      int y2 = max(v[j], v[j + 1]);
      bool ch1 = y1 > x1 && y1 < x2 && x2 < y2;
      bool ch2 = x1 > y1 && x1 < y2 && y2 < x2;
      if (ch1 || ch2) {
        ans = true;
        break;
      }
    }
  }
  if (ans)
    cout << "yes" << endl;
  else
    cout << "no" << endl;
  return;
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
