#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  std::cerr << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  std::cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const int fx[] = {+1, -1, +0, +0};
const int fy[] = {+0, +0, +1, -1};
void solve() {
  long long int n, l = 0;
  cin >> n;
  vector<pair<long long int, long long int> > v(n);
  for (long long int i = 0; i < n; i++) {
    long long int j;
    cin >> j;
    if (!i)
      v[i].first = j;
    else if (i == n - 1)
      v[i - 1].second = j;
    else {
      v[i].first = j;
      v[i - 1].second = j;
    }
  }
  n--;
  for (long long int i = 0; i < n; i++)
    if (v[i].first > v[i].second) swap(v[i].first, v[i].second);
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < i; j++) {
      if (((v[i].first - v[j].first) * (v[i].second - v[j].first) < 0) &&
          ((v[i].first - v[j].second) * (v[i].second - v[j].second) > 0)) {
        l = 1;
        break;
      } else if (((v[i].first - v[j].second) * (v[i].second - v[j].second) <
                  0) &&
                 ((v[i].first - v[j].first) * (v[i].second - v[j].first) > 0)) {
        l = 1;
        break;
      }
    }
    if (l) break;
  }
  if (l)
    cout << "yes" << '\n';
  else
    cout << "no" << '\n';
  return;
}
signed main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t = 1;
  while (t--) solve();
  return 0;
}
