#include <bits/stdc++.h>
using namespace std;
bool compare(const pair<int, int>& i, const pair<int, int>& j) {
  return i.first < j.first;
}
void solve() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int a[n];
  for (int i1 = 0; i1 < n; i1++) {
    cin >> a[i1];
  }
  for (int i1 = 0; i1 < n - 1; i1++) {
    for (int i2 = 0; i2 < n - 1; i2++) {
      int x1 = max(a[i1], a[i1 + 1]), x2 = min(a[i1], a[i1 + 1]),
          y1 = max(a[i2], a[i2 + 1]), y2 = min(a[i2], a[i2 + 1]);
      swap(x1, x2);
      swap(y1, y2);
      if (y1 >= x1 && y1 <= x2 && y2 >= x1 && y2 <= x2) {
      } else if (y1 <= x1 && y2 >= x2) {
      } else if (y1 <= x1 && y2 <= x1) {
      } else if (y1 >= x2 && y2 >= x2) {
      } else {
        cout << "yes";
        return;
      }
    }
  }
  cout << "no";
  return;
}
int main() {
  int t;
  t = 1;
  while (t--) {
    solve();
    cout << "\n";
  }
  return 0;
  return 0;
}
