#include <bits/stdc++.h>
using namespace std;
string male[] = {"lios", "etr", "initis"};
string female[] = {"liala", "etra", "inites"};
vector<int> maleVec, femaleVec;
bool isMM(vector<string>& con, vector<int>& vec, const string mm[]) {
  vec.clear();
  for (__typeof(con.begin()) i = con.begin(); i != con.end(); ++i) {
    bool flag = false;
    for (int j = 0; j < 3; j++) {
      if (i->substr(0, mm[j].size()) == mm[j]) {
        vec.push_back(j);
        flag = true;
        break;
      }
    }
    if (!flag) return false;
  }
  return true;
}
bool judge(vector<string>& con) {
  if (con.size() == 1) {
    reverse(con[0].begin(), con[0].end());
    for (int i = 0; i < 3; i++)
      if (con[0].substr(0, male[i].size()) == male[i]) return true;
    for (int i = 0; i < 3; i++)
      if (con[0].substr(0, female[i].size()) == female[i]) return true;
    return false;
  }
  for (__typeof(con.begin()) i = con.begin(); i != con.end(); ++i)
    reverse(i->begin(), i->end());
  if (isMM(con, maleVec, male)) {
    if (count(maleVec.begin(), maleVec.end(), 1) == 1) {
      int findOne = false;
      for (__typeof(maleVec.begin()) i = maleVec.begin(); i != maleVec.end();
           ++i) {
        if (*i == 1)
          findOne = true;
        else if (findOne) {
          if (*i != 2) return false;
        } else {
          if (*i != 0) return false;
        }
      }
      return true;
    } else
      return false;
  } else if (isMM(con, femaleVec, female)) {
    if (count(femaleVec.begin(), femaleVec.end(), 1) == 1) {
      int findOne = false;
      for (__typeof(femaleVec.begin()) i = femaleVec.begin();
           i != femaleVec.end(); ++i) {
        if (*i == 1)
          findOne = true;
        else if (findOne) {
          if (*i != 2) return false;
        } else {
          if (*i != 0) return false;
        }
      }
      return true;
    } else
      return false;
  } else
    return false;
}
int main() {
  string str;
  vector<string> con;
  for (int i = 0; i < 3; i++) {
    reverse(male[i].begin(), male[i].end());
    reverse(female[i].begin(), female[i].end());
  }
  while (cin >> str) con.push_back(str);
  if (judge(con))
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
