#include using namespace std; int main(){ int n; cin >> n; int a,b; for(int i = 0; i < n; i++){ int c; cin >> c; if( i == 0){ a = c;} else if( i == n-1){ b = c;} } if( a < b){ cout << "Yes" << endl;} else{ cout << "No" << endl;} return 0; }