#include <cstdio>
#include <cstring>

using namespace std;

char c[1048576];
//etr;
bool check1(char *x){
	int len=strlen(x);
	if(len<3)return false;
	if(c[len-1]!='r'||c[len-2]!='t'||c[len-3]!='e')return false;
	return true;
}
//etra
bool check2(char *x){
	int len=strlen(x);
	if(len<4)return false;
	if(c[len-1]!='a'||c[len-2]!='r'||c[len-3]!='t'||c[len-4]!='e')return false;
	return true;
}
//lios
bool check3(char *x){
	int len=strlen(x);
	if(len<4)return false;
	if(c[len-4]!='l'||c[len-3]!='i'||c[len-2]!='o'||c[len-1]!='s')return false;
	return true;
}
//liala
bool check4(char *x){
	int len=strlen(x);
	if(len<5)return false;
	if(c[len-5]!='l'||c[len-4]!='i'||c[len-3]!='a'||c[len-2]!='l'||c[len-1]!='a')return false;
	return true;
}
//initis
bool check5(char *x){
	int len=strlen(x);
	if(len<6)return false;
	if(c[len-6]!='i'||c[len-5]!='n'||c[len-4]!='i'||c[len-3]!='t'||c[len-2]!='i'||c[len-1]!='s')return false;
	return true;

}
//inites
bool check6(char *x){
	int len=strlen(x);
	if(len<6)return false;
	if(c[len-6]!='i'||c[len-5]!='n'||c[len-4]!='i'||c[len-3]!='t'||c[len-2]!='e'||c[len-1]!='s')return false;
	return true;
}

int checkword(char *c){
	if(check1(c))return 3;
	if(check2(c))return 4;
	if(check3(c))return 1;
	if(check4(c))return 2;
	if(check5(c))return 5;
	if(check6(c))return 6;
	return -1;
}
bool solve(){
	bool adj=true;
	bool nou=false;
	bool ver=false;
	bool acc=false;
	int gen=-1;
	while(scanf("%s", c)>0){
		int n=checkword(c);
		if(n<0)return false;
		if(adj){
			//printf("%d\n", gen);
			if(gen<0)gen=n&1;
			if(gen>=0 && (gen&1)!=(n&1))return false;
			//zmiana części
			if(n>2){
				adj=false;
				if(n>4){
				return false;
				}else nou=true;
			}
			continue;
		}
		if(nou){
			//printf("%d\n", gen);
			if(gen>=0 && (gen&1)!=(n&1))return false;
			if(n<5)return false;
			nou=false;
			ver=true;
			continue;
		}
		if(ver){
			//printf("%d\n", gen);
			if(gen>=0 && (gen&1)!=(n&1))return false;
			if(n<5)return false;
		}
		//printf("%d\n", gen);
	}

	return true;
}

int main(){
	if(solve())printf("YES\n");
	else printf("NO\n");
	return 0;
}


#include <cstdio>
#include <cstring>

using namespace std;

char c[104857];
//etr;
bool check1(char *x){
	int len=strlen(x);
	if(len<3)return false;
	if(c[len-1]!='r'||c[len-2]!='t'||c[len-3]!='e')return false;
	return true;
}
//etra
bool check2(char *x){
	int len=strlen(x);
	if(len<4)return false;
	if(c[len-1]!='a'||c[len-2]!='r'||c[len-3]!='t'||c[len-4]!='e')return false;
	return true;
}
//lios
bool check3(char *x){
	int len=strlen(x);
	if(len<4)return false;
	if(c[len-4]!='l'||c[len-3]!='i'||c[len-2]!='o'||c[len-1]!='s')return false;
	return true;
}
//liala
bool check4(char *x){
	int len=strlen(x);
	if(len<5)return false;
	if(c[len-5]!='l'||c[len-4]!='i'||c[len-3]!='a'||c[len-2]!='l'||c[len-1]!='a')return false;
	return true;
}
//initis
bool check5(char *x){
	int len=strlen(x);
	if(len<6)return false;
	if(c[len-6]!='i'||c[len-5]!='n'||c[len-4]!='i'||c[len-3]!='t'||c[len-2]!='i'||c[len-1]!='s')return false;
	return true;

}
//inites
bool check6(char *x){
	int len=strlen(x);
	if(len<6)return false;
	if(c[len-6]!='i'||c[len-5]!='n'||c[len-4]!='i'||c[len-3]!='t'||c[len-2]!='e'||c[len-1]!='s')return false;
	return true;
}

int checkword(char *c){
	if(check1(c))return 3;
	if(check2(c))return 4;
	if(check3(c))return 1;
	if(check4(c))return 2;
	if(check5(c))return 5;
	if(check6(c))return 6;
	return -1;
}
bool solve(){
	bool adj=true;
	bool nou=false;
	bool ver=false;
	bool acc=false;
	bool oneword=false;
	int gen=-1;
	int cnt=0;
	while(scanf("%s", c)>0){
		int n=checkword(c);
		if(n<0)return false;
		cnt++;
		if(adj){
			//printf("%d\n", gen);
			if(gen<0)gen=n&1;
			if(gen>=0 && (gen&1)!=(n&1))return false;
			//zmiana części
			if(n>2){
				adj=false;
				if(n>4){
					continue;
				}else nou=true;
				acc=true;

			}
			continue;
		}
		if(nou){
			//printf("%d\n", gen);
			if(gen>=0 && (gen&1)!=(n&1))return false;
			if(n<5)return false;
			nou=false;
			ver=true;
			continue;
		}
		if(ver){
			//printf("%d\n", gen);
			if(gen>=0 && (gen&1)!=(n&1))return false;
			if(n<5)return false;
		}
		//printf("%d\n", gen);
	}
	if(!acc&&cnt==1)return true;
	return acc;
}

int main(){
	if(solve())printf("YES\n");
	else printf("NO\n");
	return 0;
}


#include <cstdio>
#include <cstring>

using namespace std;

char c[1048576];
//etr;
bool check1(char *x){
	int len=strlen(x);
	if(len<3)return false;
	if(c[len-1]!='r'||c[len-2]!='t'||c[len-3]!='e')return false;
	return true;
}
//etra
bool check2(char *x){
	int len=strlen(x);
	if(len<4)return false;
	if(c[len-1]!='a'||c[len-2]!='r'||c[len-3]!='t'||c[len-4]!='e')return false;
	return true;
}
//lios
bool check3(char *x){
	int len=strlen(x);
	if(len<4)return false;
	if(c[len-4]!='l'||c[len-3]!='i'||c[len-2]!='o'||c[len-1]!='s')return false;
	return true;
}
//liala
bool check4(char *x){
	int len=strlen(x);
	if(len<5)return false;
	if(c[len-5]!='l'||c[len-4]!='i'||c[len-3]!='a'||c[len-2]!='l'||c[len-1]!='a')return false;
	return true;
}
//initis
bool check5(char *x){
	int len=strlen(x);
	if(len<6)return false;
	if(c[len-6]!='i'||c[len-5]!='n'||c[len-4]!='i'||c[len-3]!='t'||c[len-2]!='i'||c[len-1]!='s')return false;
	return true;

}
//inites
bool check6(char *x){
	int len=strlen(x);
	if(len<6)return false;
	if(c[len-6]!='i'||c[len-5]!='n'||c[len-4]!='i'||c[len-3]!='t'||c[len-2]!='e'||c[len-1]!='s')return false;
	return true;
}

int checkword(char *c){
	if(check1(c))return 3;
	if(check2(c))return 4;
	if(check3(c))return 1;
	if(check4(c))return 2;
	if(check5(c))return 5;
	if(check6(c))return 6;
	return -1;
}
bool solve(){
	bool adj=true;
	bool nou=false;
	bool ver=false;
	int gen=-1;
	while(scanf("%s", c)>0){
		int n=checkword(c);
		if(n<0)return false;
		if(adj){
			//printf("%d\n", gen);
			if(gen<0)gen=n&1;
			if(gen>=0 && (gen&1)!=(n&1))return false;
			//zmiana części
			if(n>2){
				adj=false;
				if(n>4)return false;
				else nou=true;
			}
			continue;
		}
		if(nou){
			//printf("%d\n", gen);
			if(gen>=0 && (gen&1)!=(n&1))return false;
			if(n<5)return false;
			nou=false;
			ver=true;
			continue;
		}
		if(ver){
			//printf("%d\n", gen);
			if(gen>=0 && (gen&1)!=(n&1))return false;
			if(n<5)return false;
		}
		//printf("%d\n", gen);
	}

	return true;
}

int main(){
	if(solve())printf("YES\n");
	else printf("NO\n");
	return 0;
}


#include <cstdio>
#include <cstring>

using namespace std;

char c[1048576];
//etr;
bool check1(char *x){
	int len=strlen(x);
	if(len<3)return false;
	if(c[len-1]!='r'||c[len-2]!='t'||c[len-3]!='e')return false;
	return true;
}
//etra
bool check2(char *x){
	int len=strlen(x);
	if(len<4)return false;
	if(c[len-1]!='a'||c[len-2]!='r'||c[len-3]!='t'||c[len-4]!='e')return false;
	return true;
}
//lios
bool check3(char *x){
	int len=strlen(x);
	if(len<4)return false;
	if(c[len-4]!='l'||c[len-3]!='i'||c[len-2]!='o'||c[len-1]!='s')return false;
	return true;
}
//liala
bool check4(char *x){
	int len=strlen(x);
	if(len<5)return false;
	if(c[len-5]!='l'||c[len-4]!='i'||c[len-3]!='a'||c[len-2]!='l'||c[len-1]!='a')return false;
	return true;
}
//initis
bool check5(char *x){
	int len=strlen(x);
	if(len<6)return false;
	if(c[len-6]!='i'||c[len-5]!='n'||c[len-4]!='i'||c[len-3]!='t'||c[len-2]!='i'||c[len-1]!='s')return false;
	return true;

}
//inites
bool check6(char *x){
	int len=strlen(x);
	if(len<6)return false;
	if(c[len-6]!='i'||c[len-5]!='n'||c[len-4]!='i'||c[len-3]!='t'||c[len-2]!='e'||c[len-1]!='s')return false;
	return true;
}

int checkword(char *c){
	if(check1(c))return 3;
	if(check2(c))return 4;
	if(check3(c))return 1;
	if(check4(c))return 2;
	if(check5(c))return 5;
	if(check6(c))return 6;
	return -1;
}
bool solve(){
	bool adj=true;
	bool nou=false;
	bool ver=false;
	int gen=0;
	while(scanf("%s", c)>0){
		int n=checkword(c);
		if(n<0)return false;
		if(adj){
			if(!gen)gen=n&1;
			if(gen && (gen&1)!=(n&1))return false;
			//zmiana części
			if(n>2){
				adj=false;
				if(n>4)return false;
				else nou=true;
			}
			continue;
		}
		if(nou){
			if(gen && (gen&1)!=(n&1))return false;
			if(n<5)return false;
			nou=false;
			ver=true;
			continue;
		}
		if(ver){
			if(gen && (gen&1)!=(n&1))return false;
			if(n<5)return false;
		}
	}
	return true;
}

int main(){
	if(solve())printf("YES\n");
	else printf("NO\n");
	return 0;
}


#include <cstdio>
#include <cstring>

using namespace std;

char c[1048576];
//etr;
bool check1(char *x){
	int len=strlen(x);
	if(len<3)return false;
	if(c[len-1]!='r'||c[len-2]!='t'||c[len-3]!='e')return false;
	return true;
}
//etra
bool check2(char *x){
	int len=strlen(x);
	if(len<4)return false;
	if(c[len-1]!='a'||c[len-2]!='r'||c[len-3]!='t'||c[len-4]!='e')return false;
	return true;
}
//lios
bool check3(char *x){
	int len=strlen(x);
	if(len<4)return false;
	if(c[len-4]!='l'||c[len-3]!='i'||c[len-2]!='o'||c[len-1]!='s')return false;
	return true;
}
//liala
bool check4(char *x){
	int len=strlen(x);
	if(len<5)return false;
	if(c[len-5]!='l'||c[len-4]!='i'||c[len-3]!='a'||c[len-2]!='l'||c[len-1]!='a')return false;
	return true;
}
//initis
bool check5(char *x){
	int len=strlen(x);
	if(len<6)return false;
	if(c[len-6]!='i'||c[len-5]!='n'||c[len-4]!='i'||c[len-3]!='t'||c[len-2]!='i'||c[len-1]!='s')return false;
	return true;

}
//inites
bool check6(char *x){
	int len=strlen(x);
	if(len<6)return false;
	if(c[len-6]!='i'||c[len-5]!='n'||c[len-4]!='i'||c[len-3]!='t'||c[len-2]!='e'||c[len-1]!='s')return false;
	return true;
}

int checkword(char *c){
	if(check1(c))return 3;
	if(check2(c))return 4;
	if(check3(c))return 1;
	if(check4(c))return 2;
	if(check5(c))return 5;
	if(check6(c))return 6;
	return -1;
}
bool solve(){
	bool adj=true;
	bool nou=false;
	bool ver=false;
	bool acc=false;
	int gen=-1;
	while(scanf("%s", c)>0){
		int n=checkword(c);
		if(n<0)return false;
		if(adj){
			//printf("%d\n", gen);
			if(gen<0)gen=n&1;
			if(gen>=0 && (gen&1)!=(n&1))return false;
			//zmiana części
			if(n>2){
				adj=false;
				if(n>4){
					ver=true;
					continue;
				}else nou=true;
			}
			continue;
		}
		if(nou){
			//printf("%d\n", gen);
			if(gen>=0 && (gen&1)!=(n&1))return false;
			if(n<5)return false;
			nou=false;
			ver=true;
			continue;
		}
		if(ver){
			//printf("%d\n", gen);
			if(gen>=0 && (gen&1)!=(n&1))return false;
			if(n<5)return false;
		}
		//printf("%d\n", gen);
	}

	return true;
}

int main(){
	if(solve())printf("YES\n");
	else printf("NO\n");
	return 0;
}


#include <cstdio>
#include <cstring>

using namespace std;

char c[1048576];
//etr;
bool check1(char *x){
	int len=strlen(x);
	if(len<3)return false;
	if(c[len-1]!='r'||c[len-2]!='t'||c[len-3]!='e')return false;
	return true;
}
//etra
bool check2(char *x){
	int len=strlen(x);
	if(len<4)return false;
	if(c[len-1]!='a'||c[len-2]!='r'||c[len-3]!='t'||c[len-4]!='e')return false;
	return true;
}
//lios
bool check3(char *x){
	int len=strlen(x);
	if(len<4)return false;
	if(c[len-4]!='l'||c[len-3]!='i'||c[len-2]!='o'||c[len-1]!='s')return false;
	return true;
}
//liala
bool check4(char *x){
	int len=strlen(x);
	if(len<5)return false;
	if(c[len-5]!='l'||c[len-4]!='i'||c[len-3]!='a'||c[len-2]!='l'||c[len-1]!='a')return false;
	return true;
}
//initis
bool check5(char *x){
	int len=strlen(x);
	if(len<6)return false;
	if(c[len-6]!='i'||c[len-5]!='n'||c[len-4]!='i'||c[len-3]!='t'||c[len-2]!='i'||c[len-1]!='s')return false;
	return true;

}
//inites
bool check6(char *x){
	int len=strlen(x);
	if(len<6)return false;
	if(c[len-6]!='i'||c[len-5]!='n'||c[len-4]!='i'||c[len-3]!='t'||c[len-2]!='e'||c[len-1]!='s')return false;
	return true;
}

int checkword(char *c){
	if(check1(c))return 3;
	if(check2(c))return 4;
	if(check3(c))return 1;
	if(check4(c))return 2;
	if(check5(c))return 5;
	if(check6(c))return 6;
	return -1;
}
bool solve(){
	bool adj=true;
	bool nou=false;
	bool ver=false;
	int gen=-1;
	while(scanf("%s", c)>0){
		int n=checkword(c);
		if(n<0)return false;
		if(adj){
			//printf("%d\n", gen);
			if(gen<0)gen=n&1;
			if(gen>=0 && (gen&1)!=(n&1))return false;
			//zmiana części
			if(n>2){
				adj=false;
				if(n>4)return false;
				else nou=true;
			}
			continue;
		}
		if(nou){
			//printf("%d\n", gen);
			if(gen>=0 && (gen&1)!=(n&1))return false;
			if(n<5)return false;
			nou=false;
			ver=true;
			continue;
		}
		if(ver){
			//printf("%d\n", gen);
			if(gen>=0 && (gen&1)!=(n&1))return false;
			if(n<5)return false;
		}
		//printf("%d\n", gen);
	}

	return !adj;
}

int main(){
	if(solve())printf("YES\n");
	else printf("NO\n");
	return 0;
}


#include <cstdio>
#include <cstring>

using namespace std;

char c[1048576];
//etr;
bool check1(char *x){
	int len=strlen(x);
	if(len<3)return false;
	if(c[len-1]!='r'||c[len-2]!='t'||c[len-3]!='e')return false;
	return true;
}
//etra
bool check2(char *x){
	int len=strlen(x);
	if(len<4)return false;
	if(c[len-1]!='a'||c[len-2]!='r'||c[len-3]!='t'||c[len-4]!='e')return false;
	return true;
}
//lios
bool check3(char *x){
	int len=strlen(x);
	if(len<4)return false;
	if(c[len-4]!='l'||c[len-3]!='i'||c[len-2]!='o'||c[len-1]!='s')return false;
	return true;
}
//liala
bool check4(char *x){
	int len=strlen(x);
	if(len<5)return false;
	if(c[len-5]!='l'||c[len-4]!='i'||c[len-3]!='a'||c[len-2]!='l'||c[len-1]!='a')return false;
	return true;
}
//initis
bool check5(char *x){
	int len=strlen(x);
	if(len<6)return false;
	if(c[len-6]!='i'||c[len-5]!='n'||c[len-4]!='i'||c[len-3]!='t'||c[len-2]!='i'||c[len-1]!='s')return false;
	return true;

}
//inites
bool check6(char *x){
	int len=strlen(x);
	if(len<6)return false;
	if(c[len-6]!='i'||c[len-5]!='n'||c[len-4]!='i'||c[len-3]!='t'||c[len-2]!='e'||c[len-1]!='s')return false;
	return true;
}

int checkword(char *c){
	if(check1(c))return 3;
	if(check2(c))return 4;
	if(check3(c))return 1;
	if(check4(c))return 2;
	if(check5(c))return 5;
	if(check6(c))return 6;
	return -1;
}
bool solve(){
	bool adj=true;
	bool nou=false;
	bool ver=false;
	int gen=0;
	while(scanf("%s", c)>0){
		int n=checkword(c);
		if(n<0)return false;
		if(adj){
			if(!gen)gen=n&1;
			if(gen && (gen&1)!=(n&1))return false;
			//zmiana części
			if(n>2){
				adj=false;
				if(n>4)return false;
				else nou=true;
			}
			continue;
		}
		if(nou){
			if(gen && (gen&1)!=(n&1))return false;
			if(n<5)return false;
			nou=false;
			ver=true;
			continue;
		}
		if(ver){
			if(gen && (gen&1)!=(n&1))return false;
		}
	}
	return true;
}

int main(){
	if(solve())printf("YES\n");
	else printf("NO\n");
	return 0;
}


#include <cstdio>
#include <cstring>

using namespace std;

char c[1048576];
//etr;
bool check1(char *x){
	int len=strlen(x);
	if(len<3)return false;
	if(c[len-1]!='r'||c[len-2]!='t'||c[len-3]!='e')return false;
	return true;
}
//etra
bool check2(char *x){
	int len=strlen(x);
	if(len<4)return false;
	if(c[len-1]!='a'||c[len-2]!='r'||c[len-3]!='t'||c[len-4]!='e')return false;
	return true;
}
//lios
bool check3(char *x){
	int len=strlen(x);
	if(len<4)return false;
	if(c[len-4]!='l'||c[len-3]!='i'||c[len-2]!='o'||c[len-1]!='s')return false;
	return true;
}
//liala
bool check4(char *x){
	int len=strlen(x);
	if(len<5)return false;
	if(c[len-5]!='l'||c[len-4]!='i'||c[len-3]!='a'||c[len-2]!='l'||c[len-1]!='a')return false;
	return true;
}
//initis
bool check5(char *x){
	int len=strlen(x);
	if(len<6)return false;
	if(c[len-6]!='i'||c[len-5]!='n'||c[len-4]!='i'||c[len-3]!='t'||c[len-2]!='i'||c[len-1]!='s')return false;
	return true;

}
//inites
bool check6(char *x){
	int len=strlen(x);
	if(len<6)return false;
	if(c[len-6]!='i'||c[len-5]!='n'||c[len-4]!='i'||c[len-3]!='t'||c[len-2]!='e'||c[len-1]!='s')return false;
	return true;
}

int checkword(char *c){
	if(check1(c))return 3;
	if(check2(c))return 4;
	if(check3(c))return 1;
	if(check4(c))return 2;
	if(check5(c))return 5;
	if(check6(c))return 6;
	return -1;
}
bool solve(){
	bool adj=true;
	bool nou=false;
	bool ver=false;
	bool acc=false;
	int gen=-1;
	while(scanf("%s", c)>0){
		int n=checkword(c);
		if(n<0)return false;
		if(adj){
			//printf("%d\n", gen);
			if(gen<0)gen=n&1;
			if(gen>=0 && (gen&1)!=(n&1))return false;
			//zmiana części
			if(n>2){
				adj=false;
				if(n>4)return false;
				else nou=true;
				acc=true;
			}
			continue;
		}
		if(nou){
			//printf("%d\n", gen);
			if(gen>=0 && (gen&1)!=(n&1))return false;
			if(n<5)return false;
			nou=false;
			ver=true;
			continue;
		}
		if(ver){
			//printf("%d\n", gen);
			if(gen>=0 && (gen&1)!=(n&1))return false;
			if(n<5)return false;
		}
		//printf("%d\n", gen);
	}

	return acc;
}

int main(){
	if(solve())printf("YES\n");
	else printf("NO\n");
	return 0;
}


#include <cstdio>
#include <cstring>

using namespace std;

char c[1048576];
//etr;
bool check1(char *x){
	int len=strlen(x);
	if(len<3)return false;
	if(c[len-1]!='r'||c[len-2]!='t'||c[len-3]!='e')return false;
	return true;
}
//etra
bool check2(char *x){
	int len=strlen(x);
	if(len<4)return false;
	if(c[len-1]!='a'||c[len-2]!='r'||c[len-3]!='t'||c[len-4]!='e')return false;
	return true;
}
//lios
bool check3(char *x){
	int len=strlen(x);
	if(len<4)return false;
	if(c[len-4]!='l'||c[len-3]!='i'||c[len-2]!='o'||c[len-1]!='s')return false;
	return true;
}
//liala
bool check4(char *x){
	int len=strlen(x);
	if(len<5)return false;
	if(c[len-5]!='l'||c[len-4]!='i'||c[len-3]!='a'||c[len-2]!='l'||c[len-1]!='a')return false;
	return true;
}
//initis
bool check5(char *x){
	int len=strlen(x);
	if(len<6)return false;
	if(c[len-6]!='i'||c[len-5]!='n'||c[len-4]!='i'||c[len-3]!='t'||c[len-2]!='i'||c[len-1]!='s')return false;
	return true;

}
//inites
bool check6(char *x){
	int len=strlen(x);
	if(len<6)return false;
	if(c[len-6]!='i'||c[len-5]!='n'||c[len-4]!='i'||c[len-3]!='t'||c[len-2]!='e'||c[len-1]!='s')return false;
	return true;
}
bool solve(){
	bool ret=true;
	while(scanf("%s", c)>0){
		if(!(check1(c)||check2(c)||check3(c)||check4(c)||check5(c)||check6(c)))ret=false;

	}
	return ret;
}

int main(){
	if(solve())printf("YES\n");
	else printf("NO\n");
	return 0;
}


#include <cstdio>
#include <cstring>

using namespace std;

char c[1048576];
//etr;
bool check1(char *x){
	int len=strlen(x);
	if(len<3)return false;
	if(c[len-1]!='r'||c[len-2]!='t'||c[len-3]!='e')return false;
	return true;
}
//etra
bool check2(char *x){
	int len=strlen(x);
	if(len<4)return false;
	len--;
	if(c[len]!='a'||c[len-1]!='r'||c[len-2]!='t'||c[len-3]!='e')return false;
	return true;
}
//lios
bool check3(char *x){
	int len=strlen(x);
	if(len<4)return false;
	if(c[len-4]!='l'||c[len-3]!='i'||c[len-2]!='o'||c[len-1]!='s')return false;
	return true;
}
//liala
bool check4(char *x){
	int len=strlen(x);
	if(len<5)return false;
	if(c[len-5]!='l'||c[len-4]!='i'||c[len-3]!='a'||c[len-2]!='l'||c[len-1]!='a')return false;
	return true;
}
//initis
bool check5(char *x){
	int len=strlen(x);
	if(len<6)return false;
	if(c[len-6]!='i'||c[len-5]!='n'||c[len-4]!='i'||c[len-3]!='t'||c[len-2]!='i'||c[len-1]!='s')return false;
	return true;

}
//inites
bool check6(char *x){
	int len=strlen(x);
	if(len<6)return false;
	if(c[len-6]!='i'||c[len-5]!='n'||c[len-4]!='i'||c[len-3]!='t'||c[len-2]!='e'||c[len-1]!='s')return false;
	return true;
}
bool solve(){
	while(scanf("%s", c)>0){
		if(!(check1(c)||check2(c)||check3(c)||check4(c)||check5(c)||check6(c)))return false;
	}
	return true;
}

int main(){
	if(solve())printf("YES\n");
	else printf("NO\n");
	return 0;
}


#include <cstdio>
#include <cstring>

using namespace std;

char c[1048576];
//etr;
bool check1(char *x){
	int len=strlen(x);
	if(len<3)return false;
	if(c[len-1]!='r'||c[len-2]!='t'||c[len-3]!='e')return false;
	return true;
}
//etra
bool check2(char *x){
	int len=strlen(x);
	if(len<4)return false;
	if(c[len-1]!='a'||c[len-2]!='r'||c[len-3]!='t'||c[len-4]!='e')return false;
	return true;
}
//lios
bool check3(char *x){
	int len=strlen(x);
	if(len<4)return false;
	if(c[len-4]!='l'||c[len-3]!='i'||c[len-2]!='o'||c[len-1]!='s')return false;
	return true;
}
//liala
bool check4(char *x){
	int len=strlen(x);
	if(len<5)return false;
	if(c[len-5]!='l'||c[len-4]!='i'||c[len-3]!='a'||c[len-2]!='l'||c[len-1]!='a')return false;
	return true;
}
//initis
bool check5(char *x){
	int len=strlen(x);
	if(len<6)return false;
	if(c[len-6]!='i'||c[len-5]!='n'||c[len-4]!='i'||c[len-3]!='t'||c[len-2]!='i'||c[len-1]!='s')return false;
	return true;

}
//inites
bool check6(char *x){
	int len=strlen(x);
	if(len<6)return false;
	if(c[len-6]!='i'||c[len-5]!='n'||c[len-4]!='i'||c[len-3]!='t'||c[len-2]!='e'||c[len-1]!='s')return false;
	return true;
}

int checkword(char *c){
	if(check1(c))return 3;
	if(check2(c))return 4;
	if(check3(c))return 1;
	if(check4(c))return 2;
	if(check5(c))return 5;
	if(check6(c))return 6;
	return -1;
}
bool solve(){
	bool adj=true;
	bool nou=false;
	bool ver=false;
	int gen=0;
	while(scanf("%s", c)>0){
		int n=checkword(c);
		if(n<0)return false;
		if(adj){
			if(!gen)gen=n&1;
			if(gen && (gen&1)!=(n&1))return false;
			//zmiana części
			if(n>2){
				adj=false;
				if(n>4)return false;
				else nou=true;
			}
			continue;
		}
		if(nou){
			if(gen && (gen&1)!=(n&1))return false;
			if(n<4)return false;
			nou=false;
			ver=true;
			continue;
		}
		if(ver){
			if(gen && (gen&1)!=(n&1))return false;
		}
	}
	return true;
}

int main(){
	if(solve())printf("YES\n");
	else printf("NO\n");
	return 0;
}


#include <cstdio>
#include <cstring>

using namespace std;

char c[1048576];
//etr;
bool check1(char *x){
	int len=strlen(x);
	if(len<3)return false;
	if(c[len-1]!='r'||c[len-2]!='t'||c[len-3]!='e')return false;
	return true;
}
//etra
bool check2(char *x){
	int len=strlen(x);
	if(len<4)return false;
	if(c[len-1]!='a'||c[len-2]!='r'||c[len-3]!='t'||c[len-4]!='e')return false;
	return true;
}
//lios
bool check3(char *x){
	int len=strlen(x);
	if(len<4)return false;
	if(c[len-4]!='l'||c[len-3]!='i'||c[len-2]!='o'||c[len-1]!='s')return false;
	return true;
}
//liala
bool check4(char *x){
	int len=strlen(x);
	if(len<5)return false;
	if(c[len-5]!='l'||c[len-4]!='i'||c[len-3]!='a'||c[len-2]!='l'||c[len-1]!='a')return false;
	return true;
}
//initis
bool check5(char *x){
	int len=strlen(x);
	if(len<6)return false;
	if(c[len-6]!='i'||c[len-5]!='n'||c[len-4]!='i'||c[len-3]!='t'||c[len-2]!='i'||c[len-1]!='s')return false;
	return true;

}
//inites
bool check6(char *x){
	int len=strlen(x);
	if(len<6)return false;
	if(c[len-6]!='i'||c[len-5]!='n'||c[len-4]!='i'||c[len-3]!='t'||c[len-2]!='e'||c[len-1]!='s')return false;
	return true;
}

int checkword(char *c){
	if(check1(c))return 3;
	if(check2(c))return 4;
	if(check3(c))return 1;
	if(check4(c))return 2;
	if(check5(c))return 5;
	if(check6(c))return 6;
	return -1;
}
bool solve(){
	bool adj=true;
	bool nou=false;
	bool ver=false;
	int gen=0;
	while(scanf("%s", c)>0){
		int n=checkword(c);
		if(n<0)return false;
		if(adj){
			if(!gen)gen=n&1;
			if(gen && (gen&1)!=(n&1))return false;
			//zmiana części
			if(n>2){
				adj=false;
				if(n>4)return false;
				else nou=true;
			}
			continue;
		}
		if(nou){
			if(gen && (gen&1)!=(n&1))return false;
			if(n<5)return false;
			nou=false;
			ver=true;
			continue;
		}
		if(ver){
			if(gen && (gen&1)!=(n&1))return false;
			if(n<5)return false;
		}
	}

	return !adj;
}

int main(){
	if(solve())printf("YES\n");
	else printf("NO\n");
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <cassert>

using namespace std;

#define MAXN 100010

string f1 = "lios";
string f2 = "liala";
string s1 = "etr";
string s2 = "etra";
string t1 = "initis";
string t2 = "inites";

char a[MAXN];
int b[3];
int n;
int rod;
string s;

inline bool isEq(int p, string t)
{
	for (int i = 0; i < t.size(); ++i)
		if (s[p + i] != t[i])
			return 0;
	return 1;
}

inline int getWord()
{
	n = s.size();
	if (n >= f1.size() && isEq(n - f1.size(), f1))
	{
		if (rod == 0)
			rod = 1;
		else
		if (rod != 1)
			return -1;
		return 0;
	}
	if (n >= f2.size() && isEq(n - f2.size(), f2))
	{
		if (rod == 0)
			rod = 2;
		else
		if (rod != 2)
			return -1;
		return 0;
	}
	if (n >= s1.size() && isEq(n - s1.size(), s1))
	{
		if (rod == 0)
			rod = 1;
		else
		if (rod != 1)
			return -1;
		return 1;
	}
	if (n >= s2.size() && isEq(n - s2.size(), s2))
	{
		if (rod == 0)
			rod = 2;
		else
		if (rod != 2)
			return -1;
		return 1;
	}
	if (n >= t1.size() && isEq(n - t1.size(), t1))
	{
		if (rod == 0)
			rod = 1;
		else
		if (rod != 1)
			return -1;
		return 2;
	}
	if (n >= t2.size() && isEq(n - t2.size(), t2))
	{
		if (rod == 0)
			rod = 2;
		else
		if (rod != 2)
			return -1;
		return 2;
	}
	return -1;
}

int main()
{
	bool ok = 1;

	b[0] = b[1] = b[2] = 0;
	rod = 0;

	while(scanf("%s", a) == 1 && ok)
	{
		s = a;
		assert(1 <= s.size() && s.size() <= MAXN);
		int t = getWord();
		if (t == -1)
		{
			ok = 0;
			break;
		}
		for (int i = t + 1; i < 3 && ok; ++i)
			if (b[i] > 0)
				ok = 0;
		assert(0 <= t && t <= 2);
		++b[t];
	}
	printf(rod > 0 && b[1] == 1 && ok ? "YES\n" : "NO\n");
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>

using namespace std;

#define MAXN 100010

string f1 = "lios";
string f2 = "liala";
string s1 = "etr";
string s2 = "etra";
string t1 = "initis";
string t2 = "inites";

char a[MAXN];
int b[3];
int n;
int rod;
string s;

inline bool isEq(int p, string t)
{
	for (int i = 0; i < t.size(); ++i)
		if (s[p + i] != t[i])
			return 0;
	return 1;
}

inline int getWord()
{
	n = s.size();
	if (n >= f1.size() && isEq(n - f1.size(), f1))
	{
		if (rod == 0)
			rod = 1;
		else
		if (rod != 1)
			return -1;
		return 1;
	}
	if (n >= f2.size() && isEq(n - f2.size(), f2))
	{
		if (rod == 0)
			rod = 2;
		else
		if (rod != 2)
			return -1;
		return 1;
	}
	if (n >= s1.size() && isEq(n - s1.size(), s1))
	{
		if (rod == 0)
			rod = 1;
		else
		if (rod != 1)
			return -1;
		return 2;
	}
	if (n >= s2.size() && isEq(n - s2.size(), s2))
	{
		if (rod == 0)
			rod = 2;
		else
		if (rod != 2)
			return -1;
		return 2;
	}
	if (n >= t1.size() && isEq(n - t1.size(), t1))
	{
		if (rod == 0)
			rod = 1;
		else
		if (rod != 1)
			return -1;
		return 3;
	}
	if (n >= t2.size() && isEq(n - t2.size(), t2))
	{
		if (rod == 0)
			rod = 2;
		else
		if (rod != 2)
			return -1;
		return 3;
	}
	return -1;
}

int main()
{
	bool ok = 1;
	b[0] = b[1] = b[2] = 0;
	rod = 0;
	while(scanf("%s", a) == 1 && ok)
	{
		s = a;
		int t = getWord();
		if (t == -1)
		{
			ok = 0;
			break;
		}
		--t;
		for (int i = t + 1; i < 3 && ok; ++i)
			if (b[i])
				ok = 0;
		++b[t];
	}
	printf(b[1] == 1 && ok ? "YES\n" : "NO\n");
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <cassert>

using namespace std;

#define MAXN 100010

string ss[3][2] = {{"lios", "liala"}, {"etr", "etra"}, {"initis", "inites"}};

char a[MAXN];
int b[3];
int n;
int rod;
string s;

inline bool isEq(int p, string t)
{
	for (int i = 0; i < t.size(); ++i)
		if (s[p + i] != t[i])
			return 0;
	return 1;
}

inline int getWord()
{
	n = s.size();
	for (int i = 0; i < 3; ++i)
		for (int j = 0; j < 2; ++j)
		{
			if (n - (int)ss[i][j].size() > 0 && s.substr(n - ss[i][j].size()) == ss[i][j])
			{
				if (rod == -1) rod = j;
				if (rod != j) return -1;
				return i;
			}
		}
	return -1;
}

int main()
{
	bool ok = 1;

	b[0] = b[1] = b[2] = 0;
	rod = -1;

	while(scanf("%s", a) == 1 && ok)
	{
		s = a;
		assert(1 <= s.size() && s.size() <= MAXN);
		int t = getWord();
		if (t == -1)
		{
			ok = 0;
			break;
		}
		for (int i = t + 1; i < 3 && ok; ++i)
			if (b[i] > 0)
				ok = 0;
		assert(0 <= t && t <= 2);
		++b[t];
	}
	printf(ok && rod >= 0 && b[1] == 1 ? "YES\n" : "NO\n");
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <cassert>

using namespace std;

#define MAXN 100010

string ss[3][2] = {{"lios", "liala"}, {"etr", "etra"}, {"initis", "inites"}};

char a[MAXN];
int b[3];
int n;
int rod;
string s;

inline bool isEq(int p, string t)
{
	for (int i = 0; i < t.size(); ++i)
		if (s[p + i] != t[i])
			return 0;
	return 1;
}

inline int getWord()
{
	n = s.size();
	for (int i = 0; i < 3; ++i)
		for (int j = 0; j < 2; ++j)
		{
			if (n - (int)ss[i][j].size() >= 0 && s.substr((int)n - (int)ss[i][j].size()) == ss[i][j])
			{
//				if (rod == -1) rod = j;
//				if (rod != j) return -1;
				return i;
			}
		}
	return -1;
}

int main()
{
	bool ok = 1;

	b[0] = b[1] = b[2] = 0;
	rod = -1;

	while(scanf("%s", a) == 1 && ok)
	{
		s = a;
		assert(1 <= s.size() && s.size() <= MAXN);
		int t = getWord();
		if (t == -1)
		{
			ok = 0;
			break;
		}
/*		for (int i = t + 1; i < 3 && ok; ++i)
			if (b[i] > 0)
				ok = 0;*/
		assert(0 <= t && t <= 2);
		++b[t];
	}
	printf(ok && b[1] == 1 ? "YES\n" : "NO\n");
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <cassert>

using namespace std;

#define MAXN 100010

string ss[3][2] = { {"lios", "liala"}, {"etr", "etra"}, {"initis", "inites"}};

char a[MAXN];
int b[3];
int n;
int rod;
string s;

inline bool isEq(int p, string t)
{
	for (int i = 0; i < t.size(); ++i)
		if (s[p + i] != t[i])
			return 0;
	return 1;
}

inline int getWord()
{
	n = s.size();
	for (int i = 0; i < 3; ++i)
		for (int j = 0; j < 2; ++j)
			if (n - ss[i][j].size() >= 0 && s.substr(n - ss[i][j].size()) == ss[i][j])
			{
				if (rod == -1) rod = j;
				if (rod != j) return -1;
				return i;
			}
	return -1;
}

int main()
{
	bool ok = 1;

	b[0] = b[1] = b[2] = 0;
	rod = -1;

	while(scanf("%s", a) == 1 && ok)
	{
		s = a;
		assert(1 <= s.size() && s.size() <= MAXN);
		int t = getWord();
		if (t == -1)
		{
			ok = 0;
			break;
		}
		for (int i = t + 1; i < 3 && ok; ++i)
			if (b[i] > 0)
				ok = 0;
		assert(0 <= t && t <= 2);
		++b[t];
	}
	printf(rod > 0 && b[1] == 1 && ok ? "YES\n" : "NO\n");
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <cassert>

using namespace std;

#define MAXN 100010

string ss[3][2] = {{"lios", "liala"}, {"etr", "etra"}, {"initis", "inites"}};

char a[MAXN];
int b[3];
int n;
int rod;
string s;

inline bool isEq(int p, string t)
{
	for (int i = 0; i < t.size(); ++i)
		if (s[p + i] != t[i])
			return 0;
	return 1;
}

inline int getWord()
{
	n = s.size();
	for (int i = 0; i < 3; ++i)
		for (int j = 0; j < 2; ++j)
		{
			if (n - (int)ss[i][j].size() >= 0 && s.substr((int)n - (int)ss[i][j].size()) == ss[i][j])
			{
				if (rod == -1) rod = j;
				if (rod != j) return -1;
				return i;
			}
		}
	return -1;
}

int main()
{
	bool ok = 1;

	b[0] = b[1] = b[2] = 0;
	rod = -1;

	while(scanf("%s", a) == 1 && ok)
	{
		s = a;
		assert(1 <= s.size() && s.size() <= MAXN);
		int t = getWord();
		if (t == -1)
		{
			ok = 0;
			break;
		}
/*		for (int i = t + 1; i < 3 && ok; ++i)
			if (b[i] > 0)
				ok = 0;*/
		assert(0 <= t && t <= 2);
		++b[t];
	}
	printf(ok? "YES\n" : "NO\n");
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <cassert>

using namespace std;

#define MAXN 100010

string ss[3][2] = {{"lios", "liala"}, {"etr", "etra"}, {"initis", "inites"}};

char a[MAXN];
int b[3];
int n;
int rod;
string s;

inline bool isEq(int p, string t)
{
	for (int i = 0; i < t.size(); ++i)
		if (s[p + i] != t[i])
			return 0;
	return 1;
}

inline int getWord()
{
	n = s.size();
	for (int i = 0; i < 3; ++i)
		for (int j = 0; j < 2; ++j)
		{
			if (n - (int)ss[i][j].size() >= 0 && s.substr((int)n - (int)ss[i][j].size()) == ss[i][j])
			{
//				if (rod == -1) rod = j;
//				if (rod != j) return -1;
				return i;
			}
		}
	return -1;
}

int main()
{
	bool ok = 1;

	b[0] = b[1] = b[2] = 0;
	rod = -1;

	while(scanf("%s", a) == 1 && ok)
	{
		s = a;
		assert(1 <= s.size() && s.size() <= MAXN);
		int t = getWord();
		if (t == -1)
		{
			ok = 0;
			break;
		}
/*		for (int i = t + 1; i < 3 && ok; ++i)
			if (b[i] > 0)
				ok = 0;*/
		assert(0 <= t && t <= 2);
		++b[t];
	}
	printf(ok? "YES\n" : "NO\n");
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <cassert>

using namespace std;

#define MAXN 100010

string ss[3][2] = {{"lios", "liala"}, {"etr", "etra"}, {"initis", "inites"}};

char a[MAXN];
int b[3];
int n;
int rod[3];
string s;

inline bool isEq(int p, string t)
{
	for (int i = 0; i < t.size(); ++i)
		if (s[p + i] != t[i])
			return 0;
	return 1;
}

inline int getWord()
{
	n = s.size();
	for (int i = 0; i < 3; ++i)
		for (int j = 0; j < 2; ++j)
		{
			if (n - (int)ss[i][j].size() > 0 && s.substr(n - (int)ss[i][j].size()) == ss[i][j])
			{
				if (rod[i] == -1) rod[i] = j;
				if (rod[i] != j) return -1;
				return i;
			}
		}
	return -1;
}

int main()
{
	bool ok = 1;

	b[0] = b[1] = b[2] = 0;
	rod[0] = rod[1] = rod[2] = -1;

	while(scanf("%s", a) == 1 && ok)
	{
		s = a;
		assert(1 <= s.size() && s.size() <= MAXN);
		int t = getWord();
		if (t == -1)
		{
			ok = 0;
			break;
		}
		for (int i = t + 1; i < 3 && ok; ++i)
			if (b[i] > 0)
				ok = 0;
		assert(0 <= t && t <= 2);
		++b[t];
	}
	printf(ok && b[1] == 1 ? "YES\n" : "NO\n");
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <cassert>

using namespace std;

#define MAXN 100010

string ss[3][2] = {{"lios", "liala"}, {"etr", "etra"}, {"initis", "inites"}};

char a[MAXN];
int b[3];
int n;
int rod[3];
string s;

inline bool isEq(int p, string t)
{
	for (int i = 0; i < t.size(); ++i)
		if (s[p + i] != t[i])
			return 0;
	return 1;
}

inline int getWord()
{
	n = s.size();
	for (int i = 0; i < 3; ++i)
		for (int j = 0; j < 2; ++j)
		{
			if (n - (int)ss[i][j].size() > 0 && s.substr(n - ss[i][j].size()) == ss[i][j])
			{
				if (rod[i] == -1) rod[i] = j;
				if (rod[i] != j) return -1;
				return i;
			}
		}
	return -1;
}

int main()
{
	bool ok = 1;

	b[0] = b[1] = b[2] = 0;
	rod[0] = rod[1] = rod[2] = -1;

	while(scanf("%s", a) == 1 && ok)
	{
		s = a;
		assert(1 <= s.size() && s.size() <= MAXN);
		int t = getWord();
		if (t == -1)
		{
			ok = 0;
			break;
		}
		for (int i = t + 1; i < 3 && ok; ++i)
			if (b[i] > 0)
				ok = 0;
		assert(0 <= t && t <= 2);
		++b[t];
	}
	printf(ok && b[1] == 1 ? "YES\n" : "NO\n");
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <cassert>

using namespace std;

#define MAXN 100010

string ss[3][2] = {{"lios", "liala"}, {"etr", "etra"}, {"initis", "inites"}};

char a[MAXN];
int b[3];
int n;
int rod[3];
string s;

inline bool isEq(int p, string t)
{
	for (int i = 0; i < t.size(); ++i)
		if (s[p + i] != t[i])
			return 0;
	return 1;
}

inline int getWord()
{
	n = s.size();
	for (int i = 0; i < 3; ++i)
		for (int j = 0; j < 2; ++j)
		{
			if (n - (int)ss[i][j].size() >= 0 && s.substr((int)n - (int)ss[i][j].size()) == ss[i][j])
			{
				if (rod[i] == -1) rod[i] = j;
				if (rod[i] != j) return -1;
				return i;
			}
		}
	return -1;
}

int main()
{
	bool ok = 1;

	b[0] = b[1] = b[2] = 0;
	rod[0] = rod[1] = rod[2] = -1;

	while(scanf("%s", a) == 1 && ok)
	{
		s = a;
		assert(1 <= s.size() && s.size() <= MAXN);
		int t = getWord();
		if (t == -1)
		{
			ok = 0;
			break;
		}
		for (int i = t + 1; i < 3 && ok; ++i)
			if (b[i] > 0)
				ok = 0;
		assert(0 <= t && t <= 2);
		++b[t];
	}
	printf(ok && b[1] == 1 ? "YES\n" : "NO\n");
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <cassert>

using namespace std;

#define MAXN 100010

string ss[3][2] = {{"lios", "liala"}, {"etr", "etra"}, {"initis", "inites"}};

char a[MAXN];
int b[3];
int n;
int rod;
string s;

inline bool isEq(int p, string t)
{
	for (int i = 0; i < t.size(); ++i)
		if (s[p + i] != t[i])
			return 0;
	return 1;
}

inline int getWord()
{
	n = s.size();
	for (int i = 0; i < 3; ++i)
		for (int j = 0; j < 2; ++j)
		{
			if (n - (int)ss[i][j].size() >= 0 && s.substr((int)n - (int)ss[i][j].size()) == ss[i][j])
			{
				if (rod == -1) rod = j;
				if (rod != j) return -1;
				return i;
			}
		}
	return -1;
}

int main()
{
	bool ok = 1;

	b[0] = b[1] = b[2] = 0;
	rod = -1;

	while(scanf("%s", a) == 1 && ok)
	{
		s = a;
		assert(1 <= s.size() && s.size() <= MAXN);
		int t = getWord();
		if (t == -1)
		{
			ok = 0;
			break;
		}
		for (int i = t + 1; i < 3 && ok; ++i)
			if (b[i] > 0)
				ok = 0;
		assert(0 <= t && t <= 2);
		++b[t];
	}
	printf(ok && b[1] == 1 ? "YES\n" : "NO\n");
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <cassert>

using namespace std;

#define MAXN 100010

string ss[3][2] = {{"lios", "liala"}, {"etr", "etra"}, {"initis", "inites"}};

char a[MAXN];
int b[3];
int n;
int rod;
string s;

inline bool isEq(int p, string t)
{
	for (int i = 0; i < t.size(); ++i)
		if (s[p + i] != t[i])
			return 0;
	return 1;
}

inline int getWord()
{
	n = s.size();
	for (int i = 0; i < 3; ++i)
		for (int j = 0; j < 2; ++j)
		{
			if ((int)n - (int)ss[i][j].size() >= 0 && s.substr((int)n - (int)ss[i][j].size()) == ss[i][j])
			{
				if (rod == -1) rod = j;
				if (rod != j) return -1;
				return i;
			}
		}
	return -1;
}

int main()
{
	bool ok = 1;

	b[0] = b[1] = b[2] = 0;
	rod = -1;
	int kol = 0;
	while(scanf("%s", a) == 1 && ok)
	{
		s = a;
		++kol;
		assert(1 <= s.size() && s.size() <= MAXN);
		int t = getWord();
		if (t == -1)
		{
			ok = 0;
			break;
		}
		for (int i = t + 1; i < 3 && ok; ++i)
			if (b[i] > 0)
				ok = 0;
		assert(0 <= t && t <= 2);
		++b[t];
	}
	printf((kol == 1 || b[1] == 1) && ok? "YES\n" : "NO\n");
	return 0;
}


#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<stdio.h>
char ml[6][10]={"lios","liala","etr","etra","initis","inites"};
int tm[7]={4,5,3,4,6,6};
int chk(char s[])
{ int i,c=0;
for(i=0;i<6;i++) if(!strcmp(ml[i],s+strlen(s)-tm[i]))return i;
return -1;};
using namespace std;
int main()
{long long int r=0,m=0,f=0,a[100005]={0},n[100005]={0},v[100005]={0},aa=0,nn=0,vv=0;
char w[100005];
  while(scanf("%s",w)!=EOF)
  {  //cout<<"loop "<<noun(w)<<" ";
  r++;
       if(chk(w)==0||chk(w)==2||chk(w)==4)
       {m++;
       if(chk(w)==0)a[aa++]=r;
       else if(chk(w)==2)n[nn++]=r;
       else v[vv++]=r;}
       else if (chk(w)<0){cout<<"NO";return 0;}
       else
       {f++;
       if(chk(w)==1)a[aa++]=r;
       else if(chk(w)==3)n[nn++]=r;
       else v[vv++]=r;}

  }
 // cout<<r<<" "<<m<<" "<<f<<" ";
  if(r==m||r==f)
  {if(aa==1&&nn==0&&vv==0)cout<<"YES";
    else if(aa==0&&nn==1&&vv==0)cout<<"YES";
   else if(aa==0&&nn==0&&vv==1)cout<<"YES";
   else if(a[0]<n[0]&&vv==0&&nn==1&&a[n[0]-1]==0)cout<<"YES";
   else if(aa==0&&n[0]<v[0]&&nn==1)cout<<"YES";
   else if(a[0]<n[0]&&n[0]<v[0]&&nn==1)cout<<"YES";
  else cout<<"NO";}
  else cout<<"NO";

return 0;
}


#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<stdio.h>
char ml[6][10]={"lios","liala","etr","etra","initis","inites"};
int tm[7]={4,5,3,4,6,6};
int chk(char s[])
{ int i,c=0;
for(i=0;i<6;i++) if(!strcmp(ml[i],s+strlen(s)-tm[i]))return i;
return -1;};
using namespace std;
int main()
{long long int r=0,m=0,f=0,a[100005]={0},n[100005]={0},v[100005]={0},aa=0,nn=0,vv=0;
char w[100005];
  while(scanf("%s",w)!=EOF)
  {  //cout<<"loop "<<noun(w)<<" ";
  r++;
       if(chk(w)==0||chk(w)==2||chk(w)==4)
       {m++;
       if(chk(w)==0)a[aa++]=r;
       else if(chk(w)==2)n[nn++]=r;
       else v[vv++]=r;}
       else if (chk(w)<0){cout<<"NO";return 0;}
       else
       {f++;
       if(chk(w)==1)a[aa++]=r;
       else if(chk(w)==3)n[nn++]=r;
       else v[vv++]=r;}

  }
 // cout<<r<<" "<<m<<" "<<f<<" ";
  if(r==m||r==f)
  {if(aa==1&&nn==0&&vv==0)cout<<"YES";
    else if(aa==0&&nn==1&&vv==0)cout<<"YES";
   else if(aa==0&&nn==0&&vv==1)cout<<"YES";
   else if(a[0]<n[0]&&vv==0&&nn==1)cout<<"YES";
   else if(aa==0&&n[0]<v[0]&&nn==1)cout<<"YES";
   else if(a[0]<n[0]&&n[0]<v[0]&&nn==1)cout<<"YES";
  else cout<<"NO";}
  else cout<<"NO";

return 0;
}


#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<stdio.h>
char ml[6][10]={"lios","liala","etr","etra","initis","inites"};
int tm[7]={4,5,3,4,6,6};
int chk(char s[])
{ int i,c=0;
for(i=0;i<6;i++) if(!strcmp(ml[i],s+strlen(s)-tm[i]))return i;
return -1;};
using namespace std;
int main()
{long long int r=0,m=0,f=0,a[100005]={0},n[100005]={0},v[100005]={0},aa=0,nn=0,vv=0;
char w[100005];
  while(scanf("%s",w)!=EOF)
  {  //cout<<"loop "<<noun(w)<<" ";
  r++;
       if(chk(w)==0||chk(w)==2||chk(w)==4)
       {m++;
       if(chk(w)==0)a[aa++]=r;
       else if(chk(w)==2)n[nn++]=r;
       else v[vv++]=r;}
       else if (chk(w)<0){cout<<"NO";return 0;}
       else
       {f++;
       if(chk(w)==1)a[aa++]=r;
       else if(chk(w)==3)n[nn++]=r;
       else v[vv++]=r;}

  }
 // cout<<r<<" "<<m<<" "<<f<<" ";
  if(r==m||r==f)
  {if(aa==1&&nn==0&&vv==0)cout<<"YES";
    else if(aa==0&&nn==1&&vv==0)cout<<"YES";
   else if(aa==0&&nn==0&&vv==1)cout<<"YES";
   else if(a[0]<n[0]&&vv==0&&nn==1&&a[nn]==0)cout<<"YES";
   else if(aa==0&&n[0]<v[0]&&nn==1)cout<<"YES";
   else if(a[0]<n[0]&&n[0]<v[0]&&nn==1)cout<<"YES";
  else cout<<"NO";}
  else cout<<"NO";

return 0;
}


#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<stdio.h>
char ml[6][10]={"lios","liala","etr","etra","initis","inites"};
int tm[7]={4,5,3,4,6,6};
int chk(char s[])
{ int i,c=0;
for(i=0;i<6;i++) if(!strcmp(ml[i],s+strlen(s)-tm[i]))return i;
return -1;};
int noun(char s[])
{ int c=0;
 if(!strcmp(ml[2],s+strlen(s)-tm[2]))c++;
   if(!strcmp(ml[3],s+strlen(s)-tm[3]))c++;
   if(c==0)return 0;
   else return 1;
};
using namespace std;
int main()
{ int n=0,r=0,m=0,f=0;
char w[105];
  while(scanf("%s",w)!=EOF)
  {  //cout<<"loop "<<noun(w)<<" ";
  r++;
       if(chk(w)==0||chk(w)==2||chk(w)==4){m++;if(noun(w)==1)n++;}
       else if (chk<0){cout<<"NO";return 0;}
       else {f++;if(noun(w)==1)n++;}

  }
 // cout<<r<<" "<<m<<" "<<f<<" ";
  if((r==m||r==f)&&n==1)cout<<"YES";
  else cout<<"NO";

return 0;
}


#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<stdio.h>
char ml[6][10]={"lios","liala","etr","etra","initis","inites"};
int tm[7]={4,5,3,4,6,6};
int chk(char s[])
{ int i,c=0;
for(i=0;i<6;i++) if(!strcmp(ml[i],s+strlen(s)-tm[i]))return i;
return -1;};
int noun(char s[])
{ int c=0;
 if(!strcmp(ml[2],s+strlen(s)-tm[2]))c++;
   if(!strcmp(ml[3],s+strlen(s)-tm[3]))c++;
   if(c==0)return 0;
   else return 1;
};
using namespace std;
int main()
{ int n=0,r=0,m=0,f=0;
char w[105];
  while(scanf("%s",w)!=EOF)
  {  //cout<<"loop "<<noun(w)<<" ";
  r++;
       if(chk(w)==0||chk(w)==2||chk(w)==4){m++;if(noun(w)==1)n++;}
       else if (chk<0){cout<<"NO";return 0;}
       else {f++;if(noun(w)==1)n++;}

  }
 // cout<<r<<" "<<m<<" "<<f<<" ";
  if(r==1&&(r==m||r==f))cout<<"YES";
  else if((r==m||r==f)&&n==1)cout<<"YES";
  else cout<<"NO";

return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string.h>
#include <stdio.h>
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
using namespace std;  // H A M L E T

bool isadj(string s){
    int t=s.size();
    if(t>=4 && s.substr(s.size()-4)=="lios")return 1;
    if(t>=5 && s.substr(s.size()-5)=="liala")return 1;
    return 0;
}

bool isnoun(string s){
    int t=s.size();
    if(t>=3 && s.substr(s.size()-3)=="etr")return 1;
    if(t>=4 && s.substr(s.size()-4)=="etra")return 1;
    return 0;
}

bool isverb(string s){
    int t=s.size();
    if(t>=6 && s.substr(s.size()-6)=="initis")return 1;
    if(t>=6 && s.substr(s.size()-6)=="inites")return 1;
    return 0;
}

int f(string s){
    if(isadj(s))return 0;
    if(isnoun(s))return 1;
    if(isverb(s))return 2;
    return -1;
}

bool genero(string s){
    int t=s.size();
    if(t>=4 && s.substr(s.size()-4)=="lios")return 1;
    if(t>=5 && s.substr(s.size()-5)=="liala")return 0;
    if(t>=3 && s.substr(s.size()-3)=="etr")return 1;
    if(t>=4 && s.substr(s.size()-4)=="etra")return 0;
    if(t>=6 && s.substr(s.size()-6)=="initis")return 1;
    if(t>=6 && s.substr(s.size()-6)=="inites")return 0;
    return 1;
}

int main(){

    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    int n;
    string aux;

    while(getline(cin,aux)){
        vector<string>v;
        istringstream is(aux);
        string aux2;
        while(is>>aux2){
            v.push_back(aux2);
        }

        if(v.size()==0){
            cout<<"NO"<<endl;
            continue;
        }

        if(v.size()==1){
            if(f(v[0])!=-1){
                cout<<"YES"<<endl;
            }else{
                cout<<"NO"<<endl;
            }
            continue;
        }
        bool ok=1;
        bool alfin=0;
        for(int i=0;i<v.size();i++){
            if(f(v[i])==1)alfin=1;

        for(int i=0;i+1<v.size();i++){
            if(f(v[i])==-1 ||f(v[i+1])==-1)ok=0;
            if( (f(v[i])==0 && f(v[i+1])==2 )|| (f(v[i])==1 && f(v[i+1])==1 )||(f(v[i])==1 && f(v[i+1])==0 )||(f(v[i])==2 && f(v[i+1])==1 )||(f(v[i])==2 && f(v[i+1])==0 ) )
                ok=0;
        }

        if(!alfin)ok=0;
        bool gen=genero(v[0]);
        for(int i=0;i<v.size();i++){
            if(gen!=genero(v[i])){
                ok=0;
            }
        }

        if(ok){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }

    }

    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string.h>
#include <stdio.h>
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
using namespace std;  // H A M L E T

bool isadj(string s){
    int t=s.size();
    if(t>=4 && s.substr(s.size()-4)=="lios")return 1;
    if(t>=5 && s.substr(s.size()-5)=="liala")return 1;
    return 0;
}

bool isnoun(string s){
    int t=s.size();
    if(t>=3 && s.substr(s.size()-3)=="etr")return 1;
    if(t>=4 && s.substr(s.size()-4)=="etra")return 1;
    return 0;
}

bool isverb(string s){
    int t=s.size();
    if(t>=6 && s.substr(s.size()-6)=="initis")return 1;
    if(t>=6 && s.substr(s.size()-6)=="inites")return 1;
    return 0;
}

int f(string s){
    if(isadj(s))return 0;
    if(isnoun(s))return 1;
    if(isverb(s))return 2;
    return -1;
}

bool genero(string s){
    int t=s.size();
    if(t>=4 && s.substr(s.size()-4)=="lios")return 1;
    if(t>=5 && s.substr(s.size()-5)=="liala")return 0;
    if(t>=3 && s.substr(s.size()-3)=="etr")return 1;
    if(t>=4 && s.substr(s.size()-4)=="etra")return 0;
    if(t>=6 && s.substr(s.size()-6)=="initis")return 1;
    if(t>=6 && s.substr(s.size()-6)=="inites")return 0;
    return 1;
}

int main(){

    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    int n;
    string aux;

    while(getline(cin,aux)){
        vector<string>v;
        istringstream is(aux);
        string aux2;
        while(is>>aux2){
            v.push_back(aux2);
        }

        if(v.size()==0){
            cout<<"NO"<<endl;
            continue;
        }

        if(v.size()==1){
            if(f(v[0])!=-1){
                cout<<"YES"<<endl;
            }else{
                cout<<"NO"<<endl;
            }
            continue;
        }
        bool ok=1;
        bool alfin=0;
        for(int i=0;i+1<v.size();i++){
            if(f(v[i])==-1 ||f(v[i+1])==-1)ok=0;
            if( f(v[i])==1)alfin=1;
            if( (f(v[i])==0 && f(v[i+1])==2 )|| (f(v[i])==1 && f(v[i+1])==1 )||(f(v[i])==1 && f(v[i+1])==0 )||(f(v[i])==2 && f(v[i+1])==1 )||(f(v[i])==2 && f(v[i+1])==0 ) )
                ok=0;
        }

        if(!alfin)ok=0;
        bool gen=genero(v[0]);
        for(int i=0;i<v.size();i++){
            if(gen!=genero(v[i])){
                ok=0;
            }
        }

        if(ok){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }

    }

    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string.h>
#include <stdio.h>
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
using namespace std;  // H A M L E T

bool isadj(string s){
    int t=s.size();
    if(t>=4 && s.substr(s.size()-4)=="lios")return 1;
    if(t>=5 && s.substr(s.size()-5)=="liala")return 1;
    return 0;
}

bool isnoun(string s){
    int t=s.size();
    if(t>=3 && s.substr(s.size()-3)=="etr")return 1;
    if(t>=4 && s.substr(s.size()-4)=="etra")return 1;
    return 0;
}

bool isverb(string s){
    int t=s.size();
    if(t>=6 && s.substr(s.size()-6)=="initis")return 1;
    if(t>=6 && s.substr(s.size()-6)=="inites")return 1;
    return 0;
}

int f(string s){
    if(isadj(s))return 0;
    if(isnoun(s))return 1;
    if(isverb(s))return 2;
    return -1;
}

int main(){

    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    int n;
    string aux;

    while(getline(cin,aux)){
        vector<string>v;
        istringstream is(aux);
        string aux2;
        while(is>>aux2){
            v.push_back(aux2);
        }

        if(v.size()==0){
            cout<<"NO"<<endl;
            continue;
        }

        if(v.size()==1){
            if(f(v[0])!=-1){
                cout<<"YES"<<endl;
            }else{
                cout<<"NO"<<endl;
            }
            continue;
        }
        bool ok=1;
        for(int i=0;i+1<v.size();i++){
            if(f(v[i])==-1 ||f(v[i+1])==-1)ok=0;
            if( (f(v[i])==0 && f(v[i+1])==2 )|| (f(v[i])==1 && f(v[i+1])==1 )||(f(v[i])==1 && f(v[i+1])==0 )||(f(v[i])==2 && f(v[i+1])==1 )||(f(v[i])==2 && f(v[i+1])==0 ) )
                ok=0;
        }

        if(ok){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }

    }

    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string.h>
#include <stdio.h>
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
using namespace std;  // H A M L E T

bool isadj(string s){
    int t=s.size();
    if(t>=4 && s.substr(s.size()-4)=="lios")return 1;
    if(t>=5 && s.substr(s.size()-5)=="liala")return 1;
    return 0;
}

bool isnoun(string s){
    int t=s.size();
    if(t>=3 && s.substr(s.size()-3)=="etr")return 1;
    if(t>=4 && s.substr(s.size()-4)=="etra")return 1;
    return 0;
}

bool isverb(string s){
    int t=s.size();
    if(t>=6 && s.substr(s.size()-6)=="initis")return 1;
    if(t>=6 && s.substr(s.size()-6)=="inites")return 1;
    return 0;
}

int f(string s){
    if(isadj(s))return 0;
    if(isnoun(s))return 1;
    if(isverb(s))return 2;
    return -1;
}

int main(){

    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    int n;
    string aux;

    while(getline(cin,aux)){
        vector<string>v;
        istringstream is(aux);
        string aux2;
        while(is>>aux2){
            v.push_back(aux2);
        }

        if(v.size()==0){
            cout<<"NO"<<endl;
            continue;
        }

        if(v.size()==1){
            if(f(v[0])==1){
                cout<<"YES"<<endl;
            }else{
                cout<<"NO"<<endl;
            }
            continue;
        }
        bool ok=1;
        for(int i=0;i+1<v.size();i++){
            if(f(v[i])==-1 ||f(v[i+1])==-1)ok=0;
            if( (f(v[i])==0 && f(v[i+1])==2 )|| (f(v[i])==1 && f(v[i+1])==1 )||(f(v[i])==1 && f(v[i+1])==0 )||(f(v[i])==2 && f(v[i+1])==1 )||(f(v[i])==2 && f(v[i+1])==0 ) )
                ok=0;
        }

        if(ok){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }

    }

    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string.h>
#include <stdio.h>
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
using namespace std;  // H A M L E T

bool isadj(string s){
    int t=s.size();
    if(t>=4 && s.substr(s.size()-4)=="lios")return 1;
    if(t>=5 && s.substr(s.size()-5)=="liala")return 1;
    return 0;
}

bool isnoun(string s){
    int t=s.size();
    if(t>=3 && s.substr(s.size()-3)=="etr")return 1;
    if(t>=4 && s.substr(s.size()-4)=="etra")return 1;
    return 0;
}

bool isverb(string s){
    int t=s.size();
    if(t>=6 && s.substr(s.size()-6)=="initis")return 1;
    if(t>=6 && s.substr(s.size()-6)=="inites")return 1;
    return 0;
}

int f(string s){
    if(isadj(s))return 0;
    if(isnoun(s))return 1;
    if(isverb(s))return 2;
    return -1;
}

bool genero(string s){
    int t=s.size();
    if(t>=4 && s.substr(s.size()-4)=="lios")return 1;
    if(t>=5 && s.substr(s.size()-5)=="liala")return 0;
    if(t>=3 && s.substr(s.size()-3)=="etr")return 1;
    if(t>=4 && s.substr(s.size()-4)=="etra")return 0;
    if(t>=6 && s.substr(s.size()-6)=="initis")return 1;
    if(t>=6 && s.substr(s.size()-6)=="inites")return 0;
    return 1;
}

int main(){

    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    int n;
    string aux;

    while(getline(cin,aux)){
        vector<string>v;
        istringstream is(aux);
        string aux2;
        while(is>>aux2){
            v.push_back(aux2);
        }

        if(v.size()==0){
            cout<<"NO"<<endl;
            continue;
        }

        if(v.size()==1){
            if(f(v[0])!=-1){
                cout<<"YES"<<endl;
            }else{
                cout<<"NO"<<endl;
            }
            continue;
        }
        bool ok=1;
        bool alfin=0;
        for(int i=0;i<v.size();i++)
            if(f(v[i])==1)alfin=1;

        for(int i=0;i+1<v.size();i++){
            if(f(v[i])==-1 ||f(v[i+1])==-1)ok=0;
            if( (f(v[i])==0 && f(v[i+1])==2 )|| (f(v[i])==1 && f(v[i+1])==1 )||(f(v[i])==1 && f(v[i+1])==0 )||(f(v[i])==2 && f(v[i+1])==1 )||(f(v[i])==2 && f(v[i+1])==0 ) )
                ok=0;
        }

        if(!alfin)ok=0;
        bool gen=genero(v[0]);
        for(int i=0;i<v.size();i++){
            if(gen!=genero(v[i])){
                ok=0;
            }
        }

        if(ok){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }

    }

    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string.h>
#include <stdio.h>
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
using namespace std;  // H A M L E T

bool isadj(string s){
    int t=s.size();
    if(t>=4 && s.substr(s.size()-4)=="lios")return 1;
    if(t>=5 && s.substr(s.size()-5)=="liala")return 1;
    return 0;
}

bool isnoun(string s){
    int t=s.size();
    if(t>=3 && s.substr(s.size()-3)=="etr")return 1;
    if(t>=4 && s.substr(s.size()-4)=="etra")return 1;
    return 0;
}

bool isverb(string s){
    int t=s.size();
    if(t>=6 && s.substr(s.size()-6)=="initis")return 1;
    if(t>=6 && s.substr(s.size()-6)=="inites")return 1;
    return 0;
}

int f(string s){
    if(isadj(s))return 0;
    if(isnoun(s))return 1;
    if(isverb(s))return 2;
    return -1;
}

bool genero(string s){
    int t=s.size();
    if(t>=4 && s.substr(s.size()-4)=="lios")return 1;
    if(t>=5 && s.substr(s.size()-5)=="liala")return 0;
    if(t>=3 && s.substr(s.size()-3)=="etr")return 1;
    if(t>=4 && s.substr(s.size()-4)=="etra")return 0;
    if(t>=6 && s.substr(s.size()-6)=="initis")return 1;
    if(t>=6 && s.substr(s.size()-6)=="inites")return 0;
    return 1;
}

int main(){

    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    int n;
    string aux;

    while(getline(cin,aux)){
        vector<string>v;
        istringstream is(aux);
        string aux2;
        while(is>>aux2){
            v.push_back(aux2);
        }

        if(v.size()==0){
            cout<<"NO"<<endl;
            continue;
        }

        if(v.size()==1){
            if(f(v[0])!=-1){
                cout<<"YES"<<endl;
            }else{
                cout<<"NO"<<endl;
            }
            continue;
        }
        bool ok=1;
        for(int i=0;i+1<v.size();i++){
            if(f(v[i])==-1 ||f(v[i+1])==-1)ok=0;
            if( (f(v[i])==0 && f(v[i+1])==2 )|| (f(v[i])==1 && f(v[i+1])==1 )||(f(v[i])==1 && f(v[i+1])==0 )||(f(v[i])==2 && f(v[i+1])==1 )||(f(v[i])==2 && f(v[i+1])==0 ) )
                ok=0;
        }

        bool gen=genero(v[0]);
        for(int i=0;i<v.size();i++){
            if(gen!=genero(v[i])){
                ok=0;
            }
        }

        if(ok){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }

    }

    return 0;
}


// =========================================================
//
//       Filename:  prob113A.cpp
//
//    Description:  http://codeforces.ru/contest/113/problem/A
//
//        Version:  1.0
//        Created:  09/08/2011 10:36:40 AM
//       Revision:  none
//       Compiler:  g++
//
//         Author:  LI YAN (lyan), lyan@cs.ucr.edu
//        Company:  U of California Riverside
//      Copyright:  Copyright (c) 09/08/2011, LI YAN
//
// =========================================================

#include <iostream>
#include <string>
#include <vector>
using namespace std;

#define sz(a) int(a.size())

int main()
{
    string words[3][2];
    words[0][0]="lios"; words[0][1]="liala";
    words[1][0]="etr";  words[1][1]="etra";
    words[2][0]="initis"; words[2][1]="inites";

    vector<string> vec;
    string text;
    while(cin >> text) vec.push_back(text);

    // check all words valid
    bool good=false;
    for(size_t k=0; k<vec.size(); ++k)
    {
    for(int i=0; i<3; ++i)
    for(int j=0; j<2; ++j)
    {
        int p,q;
        for(p=sz(words[i][j])-1, q=sz(vec[k])-1; p>=0 && q>=0; --p,--q);
        if (p<0) { good=true; break; } // found match words[][]
    }
    if (!good) break;
    }
    if (!good) { cout << "NO" << endl; return 0; }
    if (sz(vec)==1) { cout << "YES" << endl; return 0; }

    good=true;
    int type=0,gender=-1, cnt=0, noun=0;
    for(size_t k=0; k<vec.size(); ++k)
    {
    int i,j;
    for(i=0; i<3; ++i)
    for(j=0; j<2; ++j)
    {
        int p,q;
        for(p=sz(words[i][j])-1, q=sz(vec[k])-1;
            p>=0 && q>=0 && words[i][j][p]==vec[k][q]; --p,--q);
        if (p<0) { goto done; }
    }
    done:
        //cout << i << ' ' << j << ' ' << vec[k] << endl;
        if (gender<0) gender=j;
        else if (gender!=j) { good=false; break; }

        if (i==type) { cnt++; if (type==1 && cnt>=2) { good=false; break; } }
        else {
            cnt=0;
            if (i<type) { good=false; break; }
            else {
                if (i==type+1) { type=i; }
                else { good=false; break; }
            }
        }
        if (type==1) noun++;
    }
    //cout << noun << endl;
    if (good && noun==1) cout << "YES" << endl;
    else cout << "NO" << endl;
}


// =========================================================
//
//       Filename:  A.cpp
//
//    Description:
//
//        Version:  1.0
//        Created:  09/08/2011 08:14:47 AM
//       Revision:  none
//       Compiler:  g++
//
//         Author:  LI YAN (lyan), lyan@cs.ucr.edu
//        Company:  U of California Riverside
//      Copyright:  Copyright (c) 09/08/2011, LI YAN
//
// =========================================================

#include <iostream>
#include <string>
using namespace std;

#define sz(a) int(a.size())

int main()
{
    string words[3][2]; // [adj,noun,verb][mascu,femi]
    words[0][0]="lios"; words[0][1]="liala";
    words[1][0]="etr";  words[1][1]="etra";
    words[2][0]="initis";words[2][1]="inites";

    int gender=-1;
    int total=0;
    int cnt[3]={0};
    string text;
    while(cin >> text)
    {
        int tt,gg; tt=gg=-1;
        for(int i=0; i<3; ++i) for(int j=0; j<2; ++j)
        {
            if (sz(text)<sz(words[i][j])) continue;
            int p,q;
            for(p=sz(words[i][j])-1,q=sz(text)-1; p>=0; --p,--q)
            {
                if (words[i][j][p]!=text[q]) break;
            }
            if (p<0) { tt=i; gg=j; goto done;}
        }
        done:
        if (tt>=0 && gg>=0) {
            total++;
            if (gender<0) { gender=gg; }
            else { if (gender!=gg) { gender=100; break; } }
            if (tt==0) { if (cnt[1]>=1) { cnt[0]=-1; break; } }
            else if (tt==1) { if (cnt[1]>=1) { cnt[0]=-1; break; }}
            else { if (cnt[1]==0) { cnt[0]=-1; break; }}
            cnt[tt]++;
        }
    }
    //cout << cnt[0] << ' ' << cnt[1] << ' ' << cnt[2] << endl;
    //cout << gender << endl;
    if (total==1) cout << "YES" << endl;
    else if (cnt[0]>=0)
    {
        if (gender < 100 && cnt[1]==1) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    else cout << "NO" << endl;
}


// =========================================================
//
//       Filename:  prob113A.cpp
//
//    Description:  http://codeforces.ru/contest/113/problem/A
//
//        Version:  1.0
//        Created:  09/08/2011 10:36:40 AM
//       Revision:  none
//       Compiler:  g++
//
//         Author:  LI YAN (lyan), lyan@cs.ucr.edu
//        Company:  U of California Riverside
//      Copyright:  Copyright (c) 09/08/2011, LI YAN
//
// =========================================================

#include <iostream>
#include <string>
#include <vector>
using namespace std;

#define sz(a) int(a.size())

int main()
{
    string words[3][2];
    words[0][0]="lios"; words[0][1]="liala";
    words[1][0]="etr";  words[1][1]="etra";
    words[2][0]="initis"; words[2][1]="inites";

    vector<string> vec;
    string text;
    while(cin >> text) vec.push_back(text);

    // check all words valid
    bool good=false;
    for(size_t k=0; k<vec.size(); ++k)
    {
    for(int i=0; i<3; ++i)
    for(int j=0; j<2; ++j)
    {
        int p,q;
        for(p=sz(words[i][j])-1, q=sz(vec[k])-1; p>=0 && q>=0; --p,--q);
        if (p<0) { good=true; break; } // found match words[][]
    }
    if (!good) break;
    }
    if (!good) { cout << "NO" << endl; return 0; }
    if (sz(vec)==1) { cout << "YES" << endl; return 0; }

    good=true;
    int type=0,gender=-1, cnt=0, noun=0;
    for(size_t k=0; k<vec.size(); ++k)
    {
    int i,j;
    for(i=0; i<3; ++i)
    for(j=0; j<2; ++j)
    {
        int p,q;
        for(p=sz(words[i][j])-1, q=sz(vec[k])-1; p>=0 && q>=0; --p,--q);
        if (p<0) goto done;
    }
    done:
        if (gender<0) gender=j;
        else if (gender!=j) { good=false; break; }

        if (type==1) noun++;
        if (i==type) { cnt++; if (type==1 && cnt>=2) { good=false; break; } }
        else {
            cnt=0;
            if (i<type) { good=false; break; }
            else {
                if (i==type+1) { type=i; }
                else { good=false; break; }
            }
        }
    }
    if (good && noun==1) cout << "YES" << endl;
    else cout << "NO" << endl;
}


// =========================================================
//
//       Filename:  prob113A.cpp
//
//    Description:  http://codeforces.ru/contest/113/problem/A
//
//        Version:  1.0
//        Created:  09/08/2011 10:36:40 AM
//       Revision:  none
//       Compiler:  g++
//
//         Author:  LI YAN (lyan), lyan@cs.ucr.edu
//        Company:  U of California Riverside
//      Copyright:  Copyright (c) 09/08/2011, LI YAN
//
// =========================================================

#include <iostream>
#include <string>
#include <vector>
using namespace std;

#define sz(a) int(a.size())

int main()
{
    string words[3][2];
    words[0][0]="lios"; words[0][1]="liala";
    words[1][0]="etr";  words[1][1]="etra";
    words[2][0]="initis"; words[2][1]="inites";

    vector<string> vec;
    vector<int> types, genders;

    string text;
    while(cin >> text) vec.push_back(text);

    // check all words valid
    bool good=false;
    for(size_t k=0; k<vec.size(); ++k)
    {
    int i,j;
    for(i=0; i<3; ++i)
    for(j=0; j<2; ++j)
    {
        int p,q;
        for(p=sz(words[i][j])-1, q=sz(vec[k])-1;
            p>=0 && q>=0 && words[i][j][p]==vec[k][q]; --p,--q);
        if (p<0) { good=true; goto done; } // found match words[][]
    }
    done:
    if (!good) break;
    types.push_back(i); genders.push_back(j);
    }
    if (!good) { cout << "NO" << endl; return 0; }
    if (sz(vec)==1) { cout << "YES" << endl; return 0; }

    //for(int i=0; i<int(types.size()); ++i)
    //    cout << types[i] << ',' << genders[i] << "     ";
    //cout << endl;

    int cnt[3]={0};
    int gender[2]={0};
    for(int t=0,k=0; t<3; ++t)
    {
        for(; k<int(types.size()); ++k)
        {
            gender[genders[k]]++;
            if (types[k]==t) cnt[t]++; else break;
        }
    }
    good = true;
    if (cnt[0]+cnt[1]+cnt[2] < int(vec.size())) good=false;
    if (cnt[1]!=1) good=false;
    if (gender[0]>=1 && gender[1]>=1) good=false;

    if (good) cout << "YES" << endl;
    else cout << "NO" << endl;

}

// 682598   Sep 8, 2011 11:02:09 PM     lantimilan  A - Grammar Lessons     GNU
// C++  Accepted    50 ms   1600 KB
// 682540   Sep 8, 2011 11:00:20 PM     lantimilan  A - Grammar Lessons     GNU
// C++  Wrong answer on test 15     30 ms   1400 KB
// 682380   Sep 8, 2011 10:55:10 PM     lantimilan  A - Grammar Lessons     GNU
// C++  Wrong answer on test 3  30 ms   1400 KB
// 682254   Sep 8, 2011 10:50:36 PM     lantimilan  A - Grammar Lessons     GNU
// C++  Wrong answer on test 2  10 ms   1400 KB


// =========================================================
//
//       Filename:  prob113A.cpp
//
//    Description:  http://codeforces.ru/contest/113/problem/A
//
//        Version:  1.0
//        Created:  09/08/2011 10:36:40 AM
//       Revision:  none
//       Compiler:  g++
//
//         Author:  LI YAN (lyan), lyan@cs.ucr.edu
//        Company:  U of California Riverside
//      Copyright:  Copyright (c) 09/08/2011, LI YAN
//
// =========================================================

#include <iostream>
#include <string>
#include <vector>
using namespace std;

#define sz(a) int(a.size())

int main()
{
    string words[3][2];
    words[0][0]="lios"; words[0][1]="liala";
    words[1][0]="etr";  words[1][1]="etra";
    words[2][0]="initis"; words[2][1]="inites";

    vector<string> vec;
    string text;
    while(cin >> text) vec.push_back(text);

    // check all words valid
    bool good=false;
    for(size_t k=0; k<vec.size(); ++k)
    {
    for(int i=0; i<3; ++i)
    for(int j=0; j<2; ++j)
    {
        int p,q;
        for(p=sz(words[i][j])-1, q=sz(vec[k])-1;
            p>=0 && q>=0 && words[i][j][p]==vec[k][q]; --p,--q);
        if (p<0) { good=true; break; } // found match words[][]
    }
    if (!good) break;
    }
    if (!good) { cout << "NO" << endl; return 0; }
    if (sz(vec)==1) { cout << "YES" << endl; return 0; }

    good=true;
    int type=0,gender=-1, cnt=0, noun=0;
    for(size_t k=0; k<vec.size(); ++k)
    {
    int i,j;
    for(i=0; i<3; ++i)
    for(j=0; j<2; ++j)
    {
        int p,q;
        for(p=sz(words[i][j])-1, q=sz(vec[k])-1;
            p>=0 && q>=0 && words[i][j][p]==vec[k][q]; --p,--q);
        if (p<0) { goto done; }
    }
    done:
        //cout << i << ' ' << j << ' ' << vec[k] << endl;
        if (gender<0) gender=j;
        else if (gender!=j) { good=false; break; }

        if (i==type) { cnt++; if (type==1 && cnt>=2) { good=false; break; } }
        else {
            cnt=0;
            if (i<type) { good=false; break; }
            else {
                if (i==type+1) { type=i; }
                else { good=false; break; }
            }
        }
        if (type==1) noun++;
    }
    //cout << noun << endl;
    if (good && noun==1) cout << "YES" << endl;
    else cout << "NO" << endl;
}


// =========================================================
//
//       Filename:  A.cpp
//
//    Description:
//
//        Version:  1.0
//        Created:  09/08/2011 08:14:47 AM
//       Revision:  none
//       Compiler:  g++
//
//         Author:  LI YAN (lyan), lyan@cs.ucr.edu
//        Company:  U of California Riverside
//      Copyright:  Copyright (c) 09/08/2011, LI YAN
//
// =========================================================

#include <iostream>
#include <string>
using namespace std;

#define sz(a) int(a.size())

int main()
{
    string words[3][2]; // [adj,noun,verb][mascu,femi]
    words[0][0]="lios"; words[0][1]="liala";
    words[1][0]="etr";  words[1][1]="etra";
    words[2][0]="initis";words[2][1]="inites";

    int gender=-1;
    int cnt[3]={0};
    string text;
    while(cin >> text)
    {
        int tt,gg; tt=gg=-1;
        for(int i=0; i<3; ++i) for(int j=0; j<2; ++j)
        {
            if (sz(text)<sz(words[i][j])) continue;
            int p,q;
            for(p=sz(words[i][j])-1,q=sz(text)-1; p>=0; --p,--q)
            {
                if (words[i][j][p]!=text[q]) break;
            }
            if (p<0) { tt=i; gg=j; goto done;}
        }
        done:
        if (tt>=0 && gg>=0) {
            if (gender<0) { gender=gg; }
            else { if (gender!=gg) gender=100; }
            if (tt==0) { if (cnt[1]>=1) { cnt[0]=-1; break; } }
            else if (tt==1) { if (cnt[1]>=1) { cnt[0]=-1; break; }}
            else { if (cnt[1]==0) { cnt[0]=-1; break; }}
            cnt[tt]++;
        }
    }
    if (cnt[0]>=0)
    {
        if (cnt[0]+cnt[1]+cnt[2]==1) cout << "YES" << endl;
        else {
            if (gender < 100 && cnt[1]==1) cout << "YES" << endl;
            else cout << "NO" << endl;
        }
    }
    else cout << "NO" << endl;
}


// =========================================================
//
//       Filename:  prob113A.cpp
//
//    Description:  http://codeforces.ru/contest/113/problem/A
//
//        Version:  1.0
//        Created:  09/08/2011 10:36:40 AM
//       Revision:  none
//       Compiler:  g++
//
//         Author:  LI YAN (lyan), lyan@cs.ucr.edu
//        Company:  U of California Riverside
//      Copyright:  Copyright (c) 09/08/2011, LI YAN
//
// =========================================================

#include <iostream>
#include <string>
#include <vector>
using namespace std;

#define sz(a) int(a.size())

int main()
{
    string words[3][2];
    words[0][0]="lios"; words[0][1]="liala";
    words[1][0]="etr";  words[1][1]="etra";
    words[2][0]="initis"; words[2][1]="inites";

    vector<string> vec;
    string text;
    while(cin >> text) vec.push_back(text);

    // check all words valid
    bool good=false;
    for(size_t k=0; k<vec.size(); ++k)
    {
    for(int i=0; i<3; ++i)
    for(int j=0; j<2; ++j)
    {
        int p,q;
        for(p=sz(words[i][j])-1, q=sz(vec[k])-1; p>=0 && q>=0; --p,--q);
        if (p<0) { good=true; break; } // found match words[][]
    }
    if (!good) break;
    }
    if (!good) { cout << "NO" << endl; return 0; }
    if (sz(vec)==1) { cout << "YES" << endl; return 0; }

    good=true;
    int type=0,gender=-1, cnt=0;
    for(size_t k=0; k<vec.size(); ++k)
    {
    int i,j;
    for(i=0; i<3; ++i)
    for(j=0; j<2; ++j)
    {
        int p,q;
        for(p=sz(words[i][j])-1, q=sz(vec[k])-1; p>=0 && q>=0; --p,--q);
        if (p<0) goto done;
    }
    done:
        if (gender<0) gender=j;
        else if (gender!=j) { good=false; break; }
        if (i==type) { cnt++; if (type==1 && cnt>=2) { good=false; break; } }
        else {
            cnt=0;
            if (i<type) { good=false; break; }
            else {
                if (i==type+1) { type=i; }
                else { good=false; break; }
            }
        }
    }
    if (good) cout << "YES" << endl;
    else cout << "NO" << endl;
}


#include<cstdio>
#include<string>
#include<iostream>
#define ERROR {puts("NO");return 0;}
using namespace std;

const int Maxn=1e5+19;
string s[Maxn];
int is_F,n,now,cnt,tmp,noun;

int main()
{
	while (cin>>s[++n]);n--;
	now=1;tmp=-1;
	for (int i=1;i<=n;i++)
	{
		int Flag=0,x,y;
		int Len=s[i].length();
		string t="";
		for (int j=5;j>=0;j--) if (Len>=j) t=t+s[i][Len-j-1];
		Len=t.length();
		if (Len>=4&&t.substr(Len-4,4)=="lios") {if (i==1) tmp=1;x=1;Flag=1;y=1;}
		if (Len>=5&&t.substr(Len-5,5)=="liala") {if (i==1) tmp=2;x=2;Flag=1;y=1;}
		if (Len>=3&&t.substr(Len-3,3)=="etr") {if (i==1) tmp=1;x=1;Flag=1;y=2;}
		if (Len>=4&&t.substr(Len-4,4)=="etra") {if (i==1) tmp=2;x=2;Flag=1;y=2;}
		if (Len>=6&&t.substr(Len-6,6)=="initis") {if (i==1) tmp=1;x=1;Flag=1;y=3;}
		if (Len>=6&&t.substr(Len-6,6)=="inites") {if (i==1) tmp=2;x=2;Flag=1;y=3;}
		if (!Flag) ERROR;
		if (x!=tmp) ERROR;
		if (n!=1)
		{
			if (now==1)
			{
				if (y==3) ERROR;
				if (y==2) now=2,noun=1;
			}
			else
			if (now==2)
			{
				if (y==2||y==1) ERROR;
				if (y==3) now=3;
			}
			else
			if (now==3) if (y!=3) ERROR;
		}
	}
	if (n!=1&&noun!=1) ERROR;
	puts("YES");
}


#include<cstdio>
#include<string>
#include<iostream>
#define ERROR {puts("NO");return 0;}
using namespace std;

const int Maxn=1e5+19;
string s[Maxn];
int is_F,n,now,cnt,tmp;

int main()
{
	while (cin>>s[++n]);n--;
	now=1;tmp=-1;
	for (int i=1;i<=n;i++)
	{
		int Flag=0,x,y;
		int Len=s[i].length();
		if (Len>=4&&s[i].substr(Len-4,4)=="lios") {if (i==1) tmp=1;x=1;Flag=1;y=1;}
		if (Len>=5&&s[i].substr(Len-5,5)=="liala") {if (i==1) tmp=2;x=2;Flag=1;y=1;}
		if (Len>=3&&s[i].substr(Len-3,3)=="etr") {if (i==1) tmp=1;x=1;Flag=1;y=2;}
		if (Len>=4&&s[i].substr(Len-4,4)=="etra") {if (i==1) tmp=2;x=2;Flag=1;y=2;}
		if (Len>=6&&s[i].substr(Len-6,6)=="initis") {if (i==1) tmp=1;x=1;Flag=1;y=3;}
		if (Len>=6&&s[i].substr(Len-6,6)=="inites") {if (i==1) tmp=2;x=2;Flag=1;y=3;}
		if (!Flag) ERROR;
		if (x!=tmp) ERROR;
		if (now==1)
		{
			if (y==3) ERROR;
			if (y==2) now=2;
		}
		else
		if (now==2)
		{
			if (y==2||y==1) ERROR;
			if (y==3) now=3;
		}
	}
	puts("YES");
}


#include<cstdio>
#include<string>
#include<iostream>
#define ERROR {puts("NO");return 0;}
using namespace std;

const int Maxn=1e5+19;
string s[Maxn];
int is_F,n,now,cnt,tmp;

int main()
{
	while (cin>>s[++n]);n--;
	now=1;tmp=-1;
	for (int i=1;i<=n;i++)
	{
		int Flag=0,x,y;
		int Len=s[i].length();
		if (Len>=4&&s[i].substr(Len-4,4)=="lios") {if (i==1) tmp=1;x=1;Flag=1;y=1;}
		if (Len>=5&&s[i].substr(Len-5,5)=="liala") {if (i==1) tmp=2;x=2;Flag=1;y=1;}
		if (Len>=3&&s[i].substr(Len-3,3)=="etr") {if (i==1) tmp=1;x=1;Flag=1;y=2;}
		if (Len>=4&&s[i].substr(Len-4,4)=="etra") {if (i==1) tmp=2;x=2;Flag=1;y=2;}
		if (Len>=6&&s[i].substr(Len-6,6)=="initis") {if (i==1) tmp=1;x=1;Flag=1;y=3;}
		if (Len>=6&&s[i].substr(Len-6,6)=="inites") {if (i==1) tmp=2;x=2;Flag=1;y=3;}
		if (!Flag) ERROR;
		if (x!=tmp) ERROR;
		if (now==1)
		{
			if (y==3) ERROR;
			if (y==2) now=2;
		}
		else
		if (now==2)
		{
			if (y==2||y==1) ERROR;
			if (y==3) now=3;
		}
		else
		if (now==3) if (y!=3) ERROR;
	}
	puts("YES");
}


#include<cstdio>
#include<string>
#include<iostream>
#define ERROR {puts("NO");return 0;}
using namespace std;

const int Maxn=1e5+19;
string s[Maxn];
int is_F,n,now,cnt,tmp;

int main()
{
	while (cin>>s[++n]);n--;
	now=1;tmp=-1;
	for (int i=1;i<=n;i++)
	{
		int Flag=0,x,y;
		int Len=s[i].length();
		string t="";
		for (int j=5;j>=0;j--) if (Len>=j) t=t+s[i][Len-j-1];
		Len=t.length();
		if (Len>=4&&t.substr(Len-4,4)=="lios") {if (i==1) tmp=1;x=1;Flag=1;y=1;}
		if (Len>=5&&t.substr(Len-5,5)=="liala") {if (i==1) tmp=2;x=2;Flag=1;y=1;}
		if (Len>=3&&t.substr(Len-3,3)=="etr") {if (i==1) tmp=1;x=1;Flag=1;y=2;}
		if (Len>=4&&t.substr(Len-4,4)=="etra") {if (i==1) tmp=2;x=2;Flag=1;y=2;}
		if (Len>=6&&t.substr(Len-6,6)=="initis") {if (i==1) tmp=1;x=1;Flag=1;y=3;}
		if (Len>=6&&t.substr(Len-6,6)=="inites") {if (i==1) tmp=2;x=2;Flag=1;y=3;}
		if (!Flag) ERROR;
		if (x!=tmp) ERROR;
		if (now==1)
		{
			if (y==3) ERROR;
			if (y==2) now=2;
		}
		else
		if (now==2)
		{
			if (y==2||y==1) ERROR;
			if (y==3) now=3;
		}
		else
		if (now==3) if (y!=3) ERROR;
	}
	puts("YES");
}


#include<cstdio>
#include<string>
#include<iostream>
#define ERROR {puts("NO");return 0;}
using namespace std;

const int Maxn=1e5+19;
string s[Maxn];
int is_F,n,now,cnt,tmp,noun;

int main()
{
	while (cin>>s[++n]);n--;
	now=1;tmp=-1;
	for (int i=1;i<=n;i++)
	{
		int Flag=0,x,y;
		int Len=s[i].length();
		string t="";
		for (int j=5;j>=0;j--) if (Len>=j) t=t+s[i][Len-j-1];
		Len=t.length();
		if (Len>=4&&t.substr(Len-4,4)=="lios") {if (i==1) tmp=1;x=1;Flag=1;y=1;}
		if (Len>=5&&t.substr(Len-5,5)=="liala") {if (i==1) tmp=2;x=2;Flag=1;y=1;}
		if (Len>=3&&t.substr(Len-3,3)=="etr") {if (i==1) tmp=1;x=1;Flag=1;y=2;}
		if (Len>=4&&t.substr(Len-4,4)=="etra") {if (i==1) tmp=2;x=2;Flag=1;y=2;}
		if (Len>=6&&t.substr(Len-6,6)=="initis") {if (i==1) tmp=1;x=1;Flag=1;y=3;}
		if (Len>=6&&t.substr(Len-6,6)=="inites") {if (i==1) tmp=2;x=2;Flag=1;y=3;}
		if (!Flag) ERROR;
		if (x!=tmp) ERROR;
		if (n!=1)
		{
			if (now==1)
			{
				if (y==3) ERROR;
				if (y==2) now=2,noun=1;
			}
			else
			if (now==2)
			{
				if (y==2||y==1) ERROR;
				if (y==3) now=3;
			}
			else
			if (now==3) if (y!=3) ERROR;
		}
	}
	if (noun!=1) ERROR;
	puts("YES");
}


#include<cstdio>
#include<string>
#include<iostream>
#define ERROR {puts("NO");return 0;}
using namespace std;

const int Maxn=1e5+19;
string s[Maxn];
int is_F,n,now,cnt,tmp;

int main()
{
	while (cin>>s[++n]);n--;
	now=1;tmp=-1;
	for (int i=1;i<=n;i++)
	{
		int Flag=0,x,y;
		int Len=s[i].length();
		string t="";
		for (int j=5;j>=0;j--) if (Len>=j) t=t+s[i][Len-j-1];
		Len=t.length();
		if (Len>=4&&t.substr(Len-4,4)=="lios") {if (i==1) tmp=1;x=1;Flag=1;y=1;}
		if (Len>=5&&t.substr(Len-5,5)=="liala") {if (i==1) tmp=2;x=2;Flag=1;y=1;}
		if (Len>=3&&t.substr(Len-3,3)=="etr") {if (i==1) tmp=1;x=1;Flag=1;y=2;}
		if (Len>=4&&t.substr(Len-4,4)=="etra") {if (i==1) tmp=2;x=2;Flag=1;y=2;}
		if (Len>=6&&t.substr(Len-6,6)=="initis") {if (i==1) tmp=1;x=1;Flag=1;y=3;}
		if (Len>=6&&t.substr(Len-6,6)=="inites") {if (i==1) tmp=2;x=2;Flag=1;y=3;}
		if (!Flag) ERROR;
		if (x!=tmp) ERROR;
		if (n!=1)
		{
			if (now==1)
			{
				if (y==3) ERROR;
				if (y==2) now=2;
			}
			else
			if (now==2)
			{
				if (y==2||y==1) ERROR;
				if (y==3) now=3;
			}
			else
			if (now==3) if (y!=3) ERROR;
		}
	}
	puts("YES");
}


#include<bits/stdc++.h>
using namespace std;
char data[100010];
string m[]={"lios","etr","initis"};
string f[]={"liala","etra","inites"};
int main()
{
  gets(data);
  int len=strlen(data);
  vector<string>lis;
   char *ch=strtok(data," ");
   while(ch!=NULL)
   {
       string s=ch;
       lis.push_back(s);
       ch=strtok(NULL," ");
   }
   //cout<<lis.size()<<endl;
   if(lis.size()==1)
   {
       string s=lis[0];
       string tmp1,tmp2,tmp3,tmp4;
       int i=0;
       int ln=s.size();
       int j=ln-1;
       while(i<ln && i<6)
       {
           if(i<3)tmp1+=s[j];
           if(i<4)tmp2+=s[j];
           if(i<5)tmp3+=s[j];
           if(i<6)tmp4+=s[j];
           j--;
           i++;
       }
       reverse(tmp1.begin(),tmp1.end());
       reverse(tmp2.begin(),tmp2.end());
       reverse(tmp3.begin(),tmp3.end());
       reverse(tmp4.begin(),tmp4.end());
       for(int i=0;i<3;i++)
        if(tmp1==f[i] || tmp2==f[i] || tmp3==f[i] || tmp4==f[i])
       {
           puts("YES");return 0;
       }
       for(int i=0;i<3;i++)
        if(tmp1==m[i] || tmp2==m[i] || tmp3==m[i] || tmp4==m[i])
       {
           puts("YES");return 0;
       }
       puts("NO");
   }
   else
   {
       int a=0;
       int g=0,n=0;
       for(int k=0;k<lis.size();k++)
       {
          string s=lis[k];
       string tmp1,tmp2,tmp3,tmp4;
       int i=0;
       int ln=s.size();
       int j=ln-1;
       while(i<ln && i<6)
       {
           if(i<3)tmp1+=s[j];
           if(i<4)tmp2+=s[j];
           if(i<5)tmp3+=s[j];
           if(i<6)tmp4+=s[j];
           j--;
           i++;
       }
       reverse(tmp1.begin(),tmp1.end());
       reverse(tmp2.begin(),tmp2.end());
       reverse(tmp3.begin(),tmp3.end());
       reverse(tmp4.begin(),tmp4.end());
      // cout<<tmp1<<"..."<<tmp2<<" "<<tmp3<<"  "<<tmp4<<endl;
         for( j=0;j<3;j++)
         {
              if(tmp1==m[j] || tmp2==m[j] || tmp3==m[j])
              {
                   if(g==2){puts("NO");return 0;}
                   if(tmp1==m[i])n++;
                   if(n>1){puts("NO");return 0;}
                   if(n==1 && tmp2==m[j]) {puts("NO");return 0;}
                   if(tmp3==m[j] && !n){puts("NO");return 0;}
                   g=1;

              }
              else if(tmp2==f[j] || tmp3==f[j] || tmp3==f[j])
              {
                  if(g==1){puts("NO");return 0;}
                  if(tmp2==f[j])n++;
                  if(n>1){puts("NO");return 0;}
                  if(n==1 && tmp3==f[j]){puts("NO");return 0;}
                  if(tmp4==f[j] && !n){puts("NO");return 0;}
                  g=2;
              }
         }
       }
        if(!n){puts("NO");return 0;}
   puts("YES");
   }

  return 0;
}


#include<bits/stdc++.h>
using namespace std;
char data[100010];
string m[]={"lios","etr","initis"};
string f[]={"liala","etra","inites"};
int main()
{
  gets(data);
  int len=strlen(data);
  vector<string>lis;
   char *ch=strtok(data," ");
   while(ch!=NULL)
   {
       string s=ch;
       lis.push_back(s);
       ch=strtok(NULL," ");
   }
   //cout<<lis.size()<<endl;
   if(lis.size()==1)
   {
       string s=lis[0];
       string tmp1,tmp2,tmp3,tmp4;
       int i=0;
       int ln=s.size();
       int j=ln-1;
       while(i<ln && i<6)
       {
           if(i<3)tmp1+=s[j];
           if(i<4)tmp2+=s[j];
           if(i<5)tmp3+=s[j];
           if(i<6)tmp4+=s[j];
           j--;
           i++;
       }
       reverse(tmp1.begin(),tmp1.end());
       reverse(tmp2.begin(),tmp2.end());
       reverse(tmp3.begin(),tmp3.end());
       reverse(tmp4.begin(),tmp4.end());
       for(int i=0;i<3;i++)
        if(tmp1==f[i] || tmp2==f[i] || tmp3==f[i] || tmp4==f[i])
       {
           puts("YES");return 0;
       }
       for(int i=0;i<3;i++)
        if(tmp1==m[i] || tmp2==m[i] || tmp3==m[i] || tmp4==m[i])
       {
           puts("YES");return 0;
       }
       puts("NO");
   }
   else
   {
       int a=0;
       int g=0,n=0;
       for(int k=0;k<lis.size();k++)
       {
          string s=lis[k];
       string tmp1,tmp2,tmp3,tmp4;
       int i=0;
       int ln=s.size();
       int j=ln-1;
       while(i<ln && i<6)
       {
           if(i<3)tmp1+=s[j];
           if(i<4)tmp2+=s[j];
           if(i<5)tmp3+=s[j];
           if(i<6)tmp4+=s[j];
           j--;
           i++;
       }
       reverse(tmp1.begin(),tmp1.end());
       reverse(tmp2.begin(),tmp2.end());
       reverse(tmp3.begin(),tmp3.end());
       reverse(tmp4.begin(),tmp4.end());
      // cout<<tmp1<<"..."<<tmp2<<" "<<tmp3<<"  "<<tmp4<<endl;
    //  cout<<lis[k]<<" "<<g<<" "<<n<<endl;
         for( j=0;j<3;j++)
         {
              if(tmp1==m[j] || tmp2==m[j] || tmp4==m[j])
              {
                   if(g==2){puts("NO");return 0;}
                   if(tmp1==m[j] && j==1)n++;
                   if(n>1){puts("NO");return 0;}
                   if(n==1 && tmp2==m[j] && j==0) {puts("NO");return 0;}
                   if(tmp4==m[j] && !n && j==2){puts("NO");return 0;}
                   g=1;
                   break;

              }
              else if(tmp2==f[j] || tmp3==f[j] || tmp4==f[j])
              {
                  if(g==1){puts("NO");return 0;}
                  if(tmp2==f[j] && j==1)n++;
                  if(n>1){puts("NO");return 0;}
                  if(n==1 && tmp3==f[j] && j==0){puts("NO");return 0;}
                  if(tmp4==f[j] && !n && j==2){puts("NO");return 0;}
                  g=2;
                  break;
              }
              else {puts("NO");return 0;}
         }
       }
        if(!n){puts("NO");return 0;}
   puts("YES");
   }

  return 0;
}


#include<bits/stdc++.h>
using namespace std;
char data[100010];
string m[]={"lios","etr","initis"};
string f[]={"liala","etra","inites"};
int main()
{
  gets(data);
  int len=strlen(data);
  vector<string>lis;
   char *ch=strtok(data," ");
   while(ch!=NULL)
   {
       string s=ch;
       lis.push_back(s);
       ch=strtok(NULL," ");
   }
   //cout<<lis.size()<<endl;
   if(lis.size()==1)
   {
       string s=lis[0];
       string tmp1,tmp2,tmp3,tmp4;
       int i=0;
       int ln=s.size();
       int j=ln-1;
       while(i<ln && i<6)
       {
           if(i<3)tmp1+=s[j];
           if(i<4)tmp2+=s[j];
           if(i<5)tmp3+=s[j];
           if(i<6)tmp4+=s[j];
           j--;
           i++;
       }
       reverse(tmp1.begin(),tmp1.end());
       reverse(tmp2.begin(),tmp2.end());
       reverse(tmp3.begin(),tmp3.end());
       reverse(tmp4.begin(),tmp4.end());
       for(int i=0;i<3;i++)
        if(tmp1==f[i] || tmp2==f[i] || tmp3==f[i] || tmp4==f[i])
       {
           puts("YES");return 0;
       }
       for(int i=0;i<3;i++)
        if(tmp1==m[i] || tmp2==m[i] || tmp3==m[i] || tmp4==m[i])
       {
           puts("YES");return 0;
       }
       puts("NO");
   }
   else
   {
       int a=0;
       int g=0,n=0;
       for(int k=0;k<lis.size();k++)
       {
          string s=lis[k];
       string tmp1,tmp2,tmp3,tmp4;
       int i=0;
       int ln=s.size();
       int j=ln-1;
       while(i<ln && i<6)
       {
           if(i<3)tmp1+=s[j];
           if(i<4)tmp2+=s[j];
           if(i<5)tmp3+=s[j];
           if(i<6)tmp4+=s[j];
           j--;
           i++;
       }
       reverse(tmp1.begin(),tmp1.end());
       reverse(tmp2.begin(),tmp2.end());
       reverse(tmp3.begin(),tmp3.end());
       reverse(tmp4.begin(),tmp4.end());
      // cout<<tmp1<<"..."<<tmp2<<" "<<tmp3<<"  "<<tmp4<<endl;
    //  cout<<lis[k]<<" "<<g<<" "<<n<<endl;
    int check=0;
         for( j=0;j<3;j++)
         {
              if(tmp1==m[j] || tmp2==m[j] || tmp4==m[j])
              {
                   if(g==2){puts("NO");return 0;}
                   if(tmp1==m[j] && j==1)n++;
                   if(n>1){puts("NO");return 0;}
                   if(n==1 && tmp2==m[j] && j==0) {puts("NO");return 0;}
                   if(tmp4==m[j] && !n && j==2){puts("NO");return 0;}
                   g=1;check=1;
                   break;

              }
              else if(tmp2==f[j] || tmp3==f[j] || tmp4==f[j])
              {
                  if(g==1){puts("NO");return 0;}
                  if(tmp2==f[j] && j==1)n++;
                  if(n>1){puts("NO");return 0;}
                  if(n==1 && tmp3==f[j] && j==0){puts("NO");return 0;}
                  if(tmp4==f[j] && !n && j==2){puts("NO");return 0;}
                  g=2;
                  check=1;
                  break;
              }
         }
         if(!check){puts("NO");return 0;}
       }
        if(!n){puts("NO");return 0;}
   puts("YES");
   }

  return 0;
}


#include<bits/stdc++.h>
using namespace std;
char data[100010];
string m[]={"lios","etr","initis"};
string f[]={"liala","etra","inites"};
int main()
{
  gets(data);
  int len=strlen(data);
  vector<string>lis;
   char *ch=strtok(data," ");
   while(ch!=NULL)
   {
       string s=ch;
       lis.push_back(s);
       ch=strtok(NULL," ");
   }
   //cout<<lis.size()<<endl;
   if(lis.size()==1)
   {
       string s=lis[0];
       string tmp1,tmp2,tmp3,tmp4;
       int i=0;
       int ln=s.size();
       int j=ln-1;
       while(i<ln && i<6)
       {
           if(i<3)tmp1+=s[j];
           if(i<4)tmp2+=s[j];
           if(i<5)tmp3+=s[j];
           if(i<6)tmp4+=s[j];
           j--;
           i++;
       }
       reverse(tmp1.begin(),tmp1.end());
       reverse(tmp2.begin(),tmp2.end());
       reverse(tmp3.begin(),tmp3.end());
       reverse(tmp4.begin(),tmp4.end());
       for(int i=0;i<3;i++)
        if(tmp1==f[i] || tmp2==f[i] || tmp3==f[i] || tmp4==f[i])
       {
           puts("YES");return 0;
       }
       for(int i=0;i<3;i++)
        if(tmp1==m[i] || tmp2==m[i] || tmp3==m[i] || tmp4==m[i])
       {
           puts("YES");return 0;
       }
       puts("NO");
   }
   else
   {
       int a=0;
       int g=0,n=0;
       for(int k=0;k<lis.size();k++)
       {
          string s=lis[k];
       string tmp1,tmp2,tmp3,tmp4;
       int i=0;
       int ln=s.size();
       int j=ln-1;
       while(i<ln && i<6)
       {
           if(i<3)tmp1+=s[j];
           if(i<4)tmp2+=s[j];
           if(i<5)tmp3+=s[j];
           if(i<6)tmp4+=s[j];
           j--;
           i++;
       }
       reverse(tmp1.begin(),tmp1.end());
       reverse(tmp2.begin(),tmp2.end());
       reverse(tmp3.begin(),tmp3.end());
       reverse(tmp4.begin(),tmp4.end());
      // cout<<tmp1<<"..."<<tmp2<<" "<<tmp3<<"  "<<tmp4<<endl;
    //  cout<<lis[k]<<" "<<g<<" "<<n<<endl;
         for( j=0;j<3;j++)
         {
              if(tmp1==m[j] || tmp2==m[j] || tmp4==m[j])
              {
                   if(g==2){puts("NO");return 0;}
                   if(tmp1==m[j] && j==1)n++;
                   if(n>1){puts("NO");return 0;}
                   if(n==1 && tmp2==m[j] && j==0) {puts("NO");return 0;}
                   if(tmp4==m[j] && !n && j==2){puts("NO");return 0;}
                   g=1;
                   break;

              }
              else if(tmp2==f[j] || tmp3==f[j] || tmp3==f[j])
              {
                  if(g==1){puts("NO");return 0;}
                  if(tmp2==f[j] && j==1)n++;
                  if(n>1){puts("NO");return 0;}
                  if(n==1 && tmp3==f[j] && j==0){puts("NO");return 0;}
                  if(tmp4==f[j] && !n && j==2){puts("NO");return 0;}
                  g=2;
                  break;
              }
              else {puts("NO");return 0;}
         }
       }
        if(!n){puts("NO");return 0;}
   puts("YES");
   }

  return 0;
}


#include<bits/stdc++.h>
using namespace std;
char data[100010];
string m[]={"lios","etr","initis"};
string f[]={"liala","etra","inites"};
int main()
{
  gets(data);
  int len=strlen(data);
  vector<string>lis;
   char *ch=strtok(data," ");
   while(ch!=NULL)
   {
       string s=ch;
       lis.push_back(s);
       ch=strtok(NULL," ");
   }
   //cout<<lis.size()<<endl;
   if(lis.size()==1)
   {
       string s=lis[0];
       string tmp1,tmp2,tmp3,tmp4;
       int i=0;
       int ln=s.size();
       int j=ln-1;
       while(i<ln && i<6)
       {
           if(i<3)tmp1+=s[j];
           if(i<4)tmp2+=s[j];
           if(i<5)tmp3+=s[j];
           if(i<6)tmp4+=s[j];
           j--;
           i++;
       }
       reverse(tmp1.begin(),tmp1.end());
       reverse(tmp2.begin(),tmp2.end());
       reverse(tmp3.begin(),tmp3.end());
       reverse(tmp4.begin(),tmp4.end());
       for(int i=0;i<3;i++)
        if(tmp1==f[i] || tmp2==f[i] || tmp3==f[i] || tmp4==f[i])
       {
           puts("YES");return 0;
       }
       for(int i=0;i<3;i++)
        if(tmp1==m[i] || tmp2==m[i] || tmp3==m[i] || tmp4==m[i])
       {
           puts("YES");return 0;
       }
       puts("NO");
   }
   else
   {
       int a=0;
       int g=0,n=0;
       for(int k=0;k<lis.size();k++)
       {
          string s=lis[k];
       string tmp1,tmp2,tmp3,tmp4;
       int i=0;
       int ln=s.size();
       int j=ln-1;
       while(i<ln && i<6)
       {
           if(i<3)tmp1+=s[j];
           if(i<4)tmp2+=s[j];
           if(i<5)tmp3+=s[j];
           if(i<6)tmp4+=s[j];
           j--;
           i++;
       }
       reverse(tmp1.begin(),tmp1.end());
       reverse(tmp2.begin(),tmp2.end());
       reverse(tmp3.begin(),tmp3.end());
       reverse(tmp4.begin(),tmp4.end());
      // cout<<tmp1<<"..."<<tmp2<<" "<<tmp3<<"  "<<tmp4<<endl;
    //  cout<<lis[k]<<" "<<g<<" "<<n<<endl;
         for( j=0;j<3;j++)
         {
              if(tmp1==m[j] || tmp2==m[j] || tmp4==m[j])
              {
                   if(g==2){puts("NO");return 0;}
                   if(tmp1==m[j] && j==1)n++;
                   if(n>1){puts("NO");return 0;}
                   if(n==1 && tmp2==m[j] && j==0) {puts("NO");return 0;}
                   if(tmp4==m[j] && !n && j==2){puts("NO");return 0;}
                   g=1;
                   break;

              }
              else if(tmp2==f[j] || tmp3==f[j] || tmp3==f[j])
              {
                  if(g==1){puts("NO");return 0;}
                  if(tmp2==f[j] && j==1)n++;
                  if(n>1){puts("NO");return 0;}
                  if(n==1 && tmp3==f[j] && j==0){puts("NO");return 0;}
                  if(tmp4==f[j] && !n && j==2){puts("NO");return 0;}
                  g=2;
                  break;
              }
         }
       }
        if(!n){puts("NO");return 0;}
   puts("YES");
   }

  return 0;
}


//#include<iostream>
//#include<string>
//#include<vector>
#include<bits/stdc++.h>
using namespace std;
char z[10010];
string end[3][2];
vector<string> a;
vector<int> b;
void answer(string s)
{
	cout<<s<<endl;
	exit(0);
}
int calc(string s)
{
	for(int i=0;i<3;i++)
	 for(int j=0;j<2;j++)
	 	if(s.size()>=end[i][j].size()&&s.substr(s.size()-end[i][j].size())==end[i][j])
	     return i*2+j;
	 answer("NO");
	 return -1;
}
int main()
{

	while(cin>>z)
	a.push_back(z);
	end[0][0]="lios";
	end[0][1]="liala";
	end[1][0]="etr";
	end[1][1]="etra";
	end[2][0]="initis";
	end[2][1]="inites";
	b.resize(a.size());
	for(int i=0;i<a.size();i++)
	b[i]=calc(a[i]);
	if(b.size()==1)
	answer("YES");
	for(int i=0;i<a.size();i++)
	if((b[i]%2)!=(b[i+1]%2))
	answer("NO");
	int ans=0;
	for(int i=0;i<b.size();i++)
	{
		b[i]/=2;
		if(b[i]==1)
		ans++;
		if(ans>1)
		answer("NO");
	}
	for(int i=0;i<b.size();i++)
	{
		if(b[i]>b[i+1])
		answer("NO");
	}
	answer("YES");
}


//#include<iostream>
//#include<string>
//#include<vector>
#include<bits/stdc++.h>
using namespace std;
char z[200010];
int ans=0;
string end[3][2];
vector<string> a;
vector<int> b;
void answer(string s)
{
	cout<<s<<endl;
	exit(0);
}
int calc(string s)
{
	for(int i=0;i<3;i++)
	 for(int j=0;j<2;j++)
	 	if(s.size()>=end[i][j].size()&&s.substr(s.size()-end[i][j].size())==end[i][j])
	     return i*2+j;
	 answer("NO");
	 return -1;
}
int main()
{

	while(cin>>z)
	a.push_back((string)z);
	end[0][0]="lios";
	end[0][1]="liala";
	end[1][0]="etr";
	end[1][1]="etra";
	end[2][0]="initis";
	end[2][1]="inites";
	b.resize(a.size());
	for(int i=0;i<a.size();i++)
	b[i]=calc(a[i]);
	if(b.size()==1)
	answer("YES");
	for(int i=0;i<a.size();i++)
	if((b[i]%2)!=(b[i+1]%2))
	answer("NO");
	for(int i=0;i<b.size();i++)
	{
		b[i]/=2;
		if(b[i]==1)
		ans++;
		if(ans>1)
		answer("NO");
	}
	for(int i=0;i<b.size();i++)
	if(b[i]>b[i+1])
	answer("NO");
	answer("YES");
}


//#include<iostream>
//#include<string>
//#include<vector>
#include<bits/stdc++.h>
using namespace std;
char z[100010];
int ans=0;
string end[3][2];
vector<string> a;
vector<int> b;
void answer(string s)
{
	cout<<s<<endl;
	exit(0);
}
int calc(string s)
{
	for(int i=0;i<3;i++)
	 for(int j=0;j<2;j++)
	 	if(s.size()>=end[i][j].size()&&s.substr(s.size()-end[i][j].size())==end[i][j])
	     return i*2+j;
	 answer("NO");
	 return -1;
}
int main()
{
	while(cin>>z)
	a.push_back((string)z);
	end[0][0]="lios";
	end[0][1]="liala";
	end[1][0]="etr";
	end[1][1]="etra";
	end[2][0]="initis";
	end[2][1]="inites";
	b.resize(a.size());
	for(int i=0;i<a.size();i++)
	b[i]=calc(a[i]);
	if(b.size()==1)
	answer("YES");
	for(int i=0;i<b.size()-1;i++)
	if((b[i]%2)!=(b[i+1]%2))
	answer("NO");
	for(int i=0;i<b.size();i++)
	{
		b[i]/=2;
		if(b[i]==1)
		ans++;
		if(ans>1)
		answer("NO");
	}
	if(ans!=1)
	answer("NO");
	for(int i=0;i<b.size()-1;i++)
	if(b[i]>b[i+1])
	answer("NO");
	answer("YES");
	return 0;
}


//#include<iostream>
//#include<string>
//#include<vector>
#include<bits/stdc++.h>
using namespace std;
char z[10010];
int ans=0;
string end[3][2];
vector<string> a;
vector<int> b;
void answer(string s)
{
	cout<<s<<endl;
	exit(0);
}
int calc(string s)
{
	for(int i=0;i<3;i++)
	 for(int j=0;j<2;j++)
	 	if(s.size()>=end[i][j].size()&&s.substr(s.size()-end[i][j].size())==end[i][j])
	     return i*2+j;
	 answer("NO");
	 return -1;
}
int main()
{

	while(scanf("%s",z)>0)
	a.push_back((string)z);
	end[0][0]="lios";
	end[0][1]="liala";
	end[1][0]="etr";
	end[1][1]="etra";
	end[2][0]="initis";
	end[2][1]="inites";
	b.resize(a.size());
	for(int i=0;i<a.size();i++)
	b[i]=calc(a[i]);
	if(b.size()==1)
	answer("YES");
	for(int i=0;i<a.size();i++)
	if((b[i]%2)!=(b[i+1]%2))
	answer("NO");
	for(int i=0;i<b.size();i++)
	{
		b[i]/=2;
		if(b[i]==1)
		ans++;
		if(ans>1)
		answer("NO");
	}
	for(int i=0;i<b.size();i++)
	if(b[i]>b[i+1])
	answer("NO");
	answer("YES");
}


//#include<iostream>
//#include<string>
//#include<vector>
#include<bits/stdc++.h>
using namespace std;
char z[100010];
int ans=0;
string end[3][2];
vector<string> a;
vector<int> b;
void answer(string s)
{
	cout<<s<<endl;
	exit(0);
}
int calc(string s)
{
	for(int i=0;i<3;i++)
	 for(int j=0;j<2;j++)
	 	if(s.size()>=end[i][j].size()&&s.substr(s.size()-end[i][j].size())==end[i][j])
	     return i*2+j;
	 answer("NO");
	 return -1;
}
int main()
{

	while(cin>>z)
	a.push_back((string)z);
	end[0][0]="lios";
	end[0][1]="liala";
	end[1][0]="etr";
	end[1][1]="etra";
	end[2][0]="initis";
	end[2][1]="inites";
	b.resize(a.size());
	for(int i=0;i<a.size();i++)
	b[i]=calc(a[i]);
	if(b.size()==1)
	answer("YES");
	for(int i=0;i<a.size();i++)
	if((b[i]%2)!=(b[i+1]%2))
	answer("NO");
	for(int i=0;i<b.size();i++)
	{
		b[i]/=2;
		if(b[i]==1)
		ans++;
		if(ans>1)
		answer("NO");
	}
	for(int i=0;i<b.size();i++)
	if(b[i]>b[i+1])
	answer("NO");
	answer("YES");
}