#include <cstdio>
#include <algorithm>
using namespace std;
int n,p[1005];
int main()
{
    scanf("%d",&n);
    for(int i=0; i<n; i++)
        scanf("%d",p+i);
    for(int i = 0; i < n-1; i++)
        for(int j = i+1; j < n-1; j++)
        {
            int a = min(p[i],p[i+1]);
            int b = max(p[i],p[i+1]);
            int c = min(p[j],p[j+1]);
            int d = max(p[j],p[j+1]);
            if((c>a&&c<b&&d>b)||(d>a&&d<b&&c<a))
                return puts("yes"),0;
        }
    puts("no");
    return 0;
}
