#include<bits/stdc++.h>
using namespace std;
 
int main() {
    int n,a[110];
    bool f;
    cin>>n;
    for(int i = 1; i <= n; i++) {
        cin>>a[i];
    }
 
    f = false;
    for(int i = 1; i <= n - 2; i++) {
        if(a[i] >= 90&&a[i+1]>=90&&a[i+2]>=90) {
            cout<<"Y";
            f = true;
            break;
        }
    }
 
    if(!f) cout<<"N";
 
 
 
 
    return 0;
}
/**************************************************************
	Problem: 2084
	User: linzihang
	Language: C++
	Result: Accepted
	Time:47 ms
	Memory:2072 kb
****************************************************************/