#include <bits/stdc++.h>
using namespace std;
long long int max(long long int a, long long int b) {
  if (a > b) {
    return a;
  }
  return b;
}
long long int min(long long int a, long long int b) {
  if (a < b) {
    return a;
  }
  return b;
}
int main() {
  std::ios::sync_with_stdio(false);
  long long int n;
  cin >> n;
  long long int* arr = new long long int[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  multimap<long long int, long long int> mp;
  multimap<long long int, long long int>::iterator it;
  for (int i = 0; i + 1 < n; i++) {
    int start = min(arr[i + 1], arr[i]);
    int end = max(arr[i + 1], arr[i]);
    for (it = mp.begin(); it != mp.end(); it++) {
      if (it->first > start && it->first < end && it->second > end) {
        cout << "yes\n";
        return 0;
      }
      if (it->first < start && it->second < end && it->second > start) {
        cout << "yes\n";
        return 0;
      }
    }
    mp.insert({start, end});
  }
  cout << "no\n";
  delete[] arr;
  return 0;
}
