#include <bits/stdc++.h>
using namespace std;
map<string, int> gen, noun, verb, adj;
bool start;
int gend;
bool legal2(string s) {
  int lim = (int)s.size();
  int i, end = max(0, lim - 6);
  string pre;
  for (i = lim - 1; i >= end; i--)
    if (gen[s.substr(i, lim - i)]) return true;
  return false;
}
bool legal(string s) {
  int lim = (int)s.size();
  int i, end = max(0, lim - 6);
  string pre;
  for (i = lim - 1; i >= end; i--)
    if (gen[s.substr(i, lim - i)]) {
      pre = s.substr(i, lim - i);
      break;
    }
  if (i < end) return false;
  if (start) {
    if (verb[pre]) return false;
    if (noun[pre]) start = false;
  } else {
    if (!verb[pre]) return false;
  }
  if (gend) {
    if (gen[pre] != gend) return false;
  } else
    gend = gen[pre];
  return true;
}
int main() {
  gen["lios"] = 2;
  gen["etr"] = 2;
  gen["initis"] = 2;
  gen["liala"] = 1;
  gen["etra"] = 1;
  gen["inites"] = 1;
  noun["etra"] = 1;
  noun["etr"] = 1;
  verb["initis"] = 1;
  verb["inites"] = 1;
  adj["liala"] = 1;
  adj["lios"] = 1;
  vector<string> inpt;
  string tem;
  stringstream ss;
  while (getline(cin, tem)) {
    ss << tem;
    string s;
    while (ss >> s) inpt.push_back(s);
    start = true;
    gend = 0;
    bool ans = true;
    int i;
    if ((int)inpt.size() == 1) {
      if (legal2(inpt[0]))
        printf("YES\n");
      else
        printf("NO\n");
      continue;
    }
    for (i = 0; i <= (int)inpt.size() - 1; i++)
      if (!legal(inpt[i])) {
        ans = false;
        break;
      }
    if (ans && (!start))
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
