#include <bits/stdc++.h>
using namespace std;
int main() {
  int i;
  string s;
  getline(cin, s);
  string str = "";
  vector<string> v;
  for (i = 0; i < s.size(); i++) {
    if (s[i] == ' ') {
      v.push_back(str);
      str = "";
    } else {
      str += s[i];
    }
  }
  if (str != "") v.push_back(str);
  int flag = 0, male = 0, fem = 0, noun = 0, nounpos = -1;
  for (i = 0; i < v.size(); i++) {
    if (v[i].size() >= 4 && v[i].substr(v[i].size() - 4) == "lios") male++;
    if (v[i].size() >= 3 && v[i].substr(v[i].size() - 3) == "etr") {
      male++;
      noun++;
      nounpos = i;
    }
    if (v[i].size() >= 6 && v[i].substr(v[i].size() - 6) == "initis") male++;
    if (v[i].size() >= 5 && v[i].substr(v[i].size() - 5) == "liala") fem++;
    if (v[i].size() >= 4 && v[i].substr(v[i].size() - 4) == "etra") {
      fem++;
      noun++;
      nounpos = i;
    }
    if (v[i].size() >= 6 && v[i].substr(v[i].size() - 6) == "inites") fem++;
  }
  if (v.size() == 1 && (fem || male)) {
    cout << "YES";
    return 0;
  }
  if ((fem && male) || noun != 1)
    flag = 1;
  else {
    if (male) {
      for (i = 0; i < nounpos; i++) {
        if (!(v[i].size() >= 4 && v[i].substr(v[i].size() - 4) == "lios"))
          flag = 1;
      }
      for (i = nounpos + 1; i < v.size(); i++) {
        if (!(v[i].size() >= 6 && v[i].substr(v[i].size() - 6) == "initis"))
          flag = 1;
      }
    } else {
      for (i = 0; i < nounpos; i++) {
        if (!(v[i].size() >= 5 && v[i].substr(v[i].size() - 5) == "liala"))
          flag = 1;
      }
      for (i = nounpos + 1; i < v.size(); i++) {
        if (!(v[i].size() >= 6 && v[i].substr(v[i].size() - 6) == "inites"))
          flag = 1;
      }
    }
  }
  if (flag)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
