#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 4;
int a[N];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    int x = 0;
    int y = 0;
    for (int j = i + 2; j < n; j++)
      if ((a[j] > a[i] && a[j] > a[i + 1]) || (a[j] < a[i] && a[j] < a[i + 1]))
        x++;
      else
        y++;
    if (x && y) {
      cout << "yes";
      return 0;
    }
  }
  cout << "no";
  return 0;
}
