#include <bits/stdc++.h>
using namespace std;
int main() {
  string s[] = {"lios", "liala", "etr", "etra", "initis", "inites"}, str;
  int last = 0, cnt = 0, all = 0, end = -1, flag = 1;
  while (cin >> str) {
    all++;
    str = string(10, 'X') + str;
    int l = (int)(str).size();
    for (int i = 0; i < (6); ++i)
      if (str.substr(l - (int)(s[i]).size(), (int)(s[i]).size()) == s[i]) {
        int type = i / 2, gender = i % 2;
        if (type < last) flag = 0;
        if (end < 0)
          end = gender;
        else if (end != gender)
          flag = 0;
        if (type == 1) cnt++;
        last = type;
        goto C;
      }
    flag = 0;
    goto D;
  C:;
  }
  flag &= cnt == 1;
  if (all == 1) flag = 1;
D:;
  cout << (flag ? "YES" : "NO") << endl;
  return 0;
}
