#include <bits/stdc++.h>
using namespace std;
bool check(string x, string y) {
  return x.size() >= y.size() && x.substr(x.size() - y.size()) == y;
}
bool isadj(string x) { return check(x, "lios") || check(x, "liala"); }
bool isnoun(string x) { return check(x, "etr") || check(x, "etra"); }
bool isverb(string x) { return check(x, "initis") || check(x, "inites"); }
bool isfem(string x) {
  return check(x, "liala") || check(x, "etra") || check(x, "inites");
}
bool isword(string x) { return isverb(x) || isnoun(x) || isadj(x); }
deque<string> dq;
string x;
int main() {
  while (cin >> x) dq.push_back(x);
  for (int i = 0; i < dq.size(); ++i)
    if (!isword(dq[i])) return puts("NO");
  if (dq.size() == 1) return puts("YES");
  for (int i = 0; i < dq.size() - 1; ++i)
    if (isfem(dq[i]) != isfem(dq[i + 1])) return puts("NO");
  while (dq.size() && isadj(dq.front())) dq.pop_front();
  while (dq.size() && isverb(dq.back())) dq.pop_back();
  if (dq.size() == 1)
    return puts("YES");
  else
    puts("NO");
}
