import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
import static java.
lang.
Math.
*; import static java.
util.
Arrays.
*;
public class A{
Scanner sc
=new Scanner
(System.
in);
int INF=1<<28;
double EPS=1e-9;
String[] adjs
={"lios",
"liala"}; String[] nouns
={"etr",
"etra"}; String[] verbs
={"initis",
"inites"};
void run(){
String[] ss
=sc.
nextLine().
split(" "); if(match(ss, 0)||match(ss, 1)){
println("YES");
}else{
println("NO");
}
}
boolean match
(String[] ss,
int gender
){ if(ss.length==1){
if(ss[0].endsWith(adjs[gender])||ss[0].endsWith(nouns[gender])
||ss[0].endsWith(verbs[gender])){
return true;
}
}
int state=1;
if(state==1){
if(s.endsWith(adjs[gender])){
state=1;
}else if(s.endsWith(nouns[gender])){
state=2;
}else{
return false;
}
}else if(state==2){
if(s.endsWith(verbs[gender])){
state=2;
}else{
return false;
}
}
}
return state==2;
}
}
}
}
public static void main
(String[] args
){ new A().run();
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLm1hdGguKjsKaW1wb3J0IGphdmEuaW8uKjsKCmltcG9ydCBzdGF0aWMgamF2YS5sYW5nLk1hdGguKjsKaW1wb3J0IHN0YXRpYyBqYXZhLnV0aWwuQXJyYXlzLio7CgpwdWJsaWMgY2xhc3MgQXsKCVNjYW5uZXIgc2M9bmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKCglpbnQgSU5GPTE8PDI4OwoJZG91YmxlIEVQUz0xZS05OwoKCVN0cmluZ1tdIGFkanM9eyJsaW9zIiwgImxpYWxhIn07CglTdHJpbmdbXSBub3Vucz17ImV0ciIsICJldHJhIn07CglTdHJpbmdbXSB2ZXJicz17ImluaXRpcyIsICJpbml0ZXMifTsKCgl2b2lkIHJ1bigpewoJCVN0cmluZ1tdIHNzPXNjLm5leHRMaW5lKCkuc3BsaXQoIiAiKTsKCQlpZihtYXRjaChzcywgMCl8fG1hdGNoKHNzLCAxKSl7CgkJC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