#include <bits/stdc++.h>
using namespace std;
void swap(int *a, int *b) {
  int temp;
  temp = *a;
  *a = *b;
  *b = temp;
}
int main() {
  int n;
  cin >> n;
  int x1, x2, x3, x4;
  int array[n];
  int i = 0, j = 0;
  for (i = 0; i < n; i += 1) cin >> array[i];
  bool ans = false;
  for (i = 0; i < n; i += 1) {
    if (i + 1 >= n) break;
    x1 = array[i];
    x2 = array[i + 1];
    if (x1 > x2) swap(&x1, &x2);
    for (j = 0; j < n; j += 1) {
      if (j + 1 >= n) break;
      x3 = array[j];
      x4 = array[j + 1];
      if (x3 > x4) swap(&x3, &x4);
      if (x1 < x3 and x3 < x2 and x2 < x4) {
        ans = true;
        break;
      } else if (x3 < x1 and x1 < x4 and x4 < x2) {
        ans = true;
        break;
      }
    }
  }
  if (ans)
    cout << "yes" << endl;
  else
    cout << "no" << endl;
  return 0;
}
