#include<iostream>
#include<algorithm>
#include<queue>
#include <climits>
#include<string>
using namespace std;
int eto[12]; int N;
string str;
int main(){
    cin >> N;
    int maxV = 0;
    for(int i = 0; i < N; i++){
        cin >> str;
        if(str == "ne") eto[0]++;
        else if(str == "ushi") eto[1]++;
        else if(str == "tra") eto[2]++;
        else if(str == "u") eto[3]++;
        else if(str == "tatsu") eto[4]++;
        else if(str == "mi") eto[5]++;
        else if(str == "uma") eto[6]++;
        else if(str == "hitsuji") eto[7]++;
        else if(str == "saru") eto[8]++;
        else if(str == "tori") eto[9]++;
        else if(str == "inu") eto[10]++;
        else if(str == "i") eto[11]++;
    }
    for(int i = 0; i < 12; i++){
        maxV = max(maxV, eto[i]);
    }
    if(N == 1){
        cout << "YES" << endl;
    }else if(N >= 2){
        if(N - (N/2) >= maxV) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}