#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
  long x;
  cin >> x;
  long long *arr = new long long[x];
  for (long i = 0; i < x; i++) {
    cin >> arr[i];
  }
  int c = 0;
  for (long i = 0; i < x - 1; i++) {
    for (long j = 0; j < x - 1; j++) {
      if (max(arr[i], arr[i + 1]) < max(arr[j], arr[j + 1]) &&
          min(arr[i], arr[i + 1]) < min(arr[j], arr[j + 1]) &&
          max(arr[i], arr[i + 1]) > min(arr[j], arr[j + 1]))
        c++;
    }
  }
  if (c == 0)
    cout << "no";
  else
    cout << "yes";
  return 0;
}
