#include <bits/stdc++.h>
using namespace std;
int w;
string s;
bool male, female, state, a;
bool find(string s, string t) {
  if (s.size() < t.size()) return 0;
  reverse(s.begin(), s.end());
  reverse(t.begin(), t.end());
  for (int i = 0; i < t.size(); i++)
    if (s[i] != t[i]) return 0;
  return 1;
}
int main() {
  ios::sync_with_stdio(0);
  while (cin >> s) {
    w++;
    if (!state) {
      if (find(s, "lios"))
        male = 1;
      else if (find(s, "liala"))
        female = 1;
      else if (find(s, "etra"))
        female = 1, state = 1, a = 1;
      else if (find(s, "etr"))
        male = 1, state = 1, a = 1;
      else if (find(s, "initis") && !male && !female)
        male = 1, state = 1;
      else if (find(s, "inites") && !male && !female)
        female = 1, state = 1;
      else
        return cout << "NO", 0;
    } else if (state) {
      if (find(s, "initis"))
        male = 1;
      else if (find(s, "inites"))
        female = 1;
      else
        return cout << "NO", 0;
    }
  }
  if (male && female || !a && w > 1)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
  return 0;
}
