#include<iostream>
using namespace std ;
int main()
{
int n ;
cin>>n;
long long seats[n];
for(long long i =0 ; i<n ;i++)cin>>seats[i];
for(long long i =0 ; i<n-1; i++)
{
if(seats[i]>=seats[i+1])
{
cout<<"NO";
return 0;
}
}
cout<<"YES";
}