#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  std::ios::sync_with_stdio(false);
  int n;
  cin >> n;
  long long A[n];
  for (int i = 0; i < n; i++) {
    cin >> A[i];
  }
  if (n == 1) {
    cout << "no";
    return 0;
  }
  for (int i = 1; i < n; i++) {
    long long nim1 = min(A[i], A[i - 1]), xam1 = max(A[i], A[i - 1]);
    for (int j = 2; j < n; j++) {
      long long nim2 = min(A[j], A[j - 1]), xam2 = max(A[j], A[j - 1]);
      if (nim2 < nim1 && xam2 > nim1 && xam2 < xam1) {
        cout << "yes";
        return 0;
      } else if (nim2 > nim1 && nim2 < xam1 && xam2 > xam1) {
        cout << "yes";
        return 0;
      }
    }
  }
  cout << "no";
  return 0;
}
