#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  bool bol = false;
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 2; j < n - 1; j++) {
      int a, b, c, d;
      a = min(arr[i], arr[i + 1]);
      b = max(arr[i], arr[i + 1]);
      if (arr[j] > a && arr[j] < b && !(arr[j + 1] > a && arr[j + 1] < b)) {
        bol = true;
        break;
      }
      if (arr[j + 1] > a && arr[j + 1] < b && !(arr[j] > a && arr[j] < b)) {
        bol = true;
        break;
      }
    }
    if (bol) break;
  }
  if (bol)
    cout << "yes\n";
  else
    cout << "no\n";
  return 0;
}
