#include <bits/stdc++.h>
using namespace std;
string s;
stringstream str;
int last = -1, last2 = -1, ns;
void Die() {
  puts("NO");
  exit(0);
}
int Type(string s) {
  if (s.size() >= 4)
    if (s.substr(s.size() - 4, 4) == "lios") return 0;
  if (s.size() >= 5)
    if (s.substr(s.size() - 5, 5) == "liala") return 1;
  if (s.size() >= 3)
    if (s.substr(s.size() - 3, 3) == "etr") return 2;
  if (s.size() >= 4)
    if (s.substr(s.size() - 4, 4) == "etra") return 3;
  if (s.size() >= 6)
    if (s.substr(s.size() - 6, 6) == "initis") return 4;
  if (s.size() >= 6)
    if (s.substr(s.size() - 6, 6) == "inites") return 5;
  return -1;
}
int main() {
  getline(cin, s);
  str << s;
  while (str >> s) {
    last = last2;
    int t = Type(s);
    if (t == -1) Die();
    if (last != -1 and last % 2 != t % 2) Die();
    if (last > t) Die();
    if (t / 2 == 1) ns++;
    last2 = t;
  }
  if (last != -1 and ns != 1) Die();
  puts("YES");
  return 0;
}
