#include <bits/stdc++.h>
using namespace std;
const double TOLL = 1e-9;
vector<string> words;
istringstream is;
bool la(const string& x, const string& y) {
  if ((int((x).size())) < (int((y).size()))) return false;
  int ind = (int((x).size())) - (int((y).size()));
  for (int i = 0; i < (int((y).size())); i++)
    if (x[ind + i] != y[i]) return false;
  return true;
}
string typeOf(const string& x) {
  if (la(x, "lios")) return "madj";
  if (la(x, "liala")) return "fadj";
  if (la(x, "etr")) return "mnoun";
  if (la(x, "etra")) return "fnoun";
  if (la(x, "initis")) return "mverb";
  if (la(x, "inites")) return "fverb";
  return "----";
}
bool ok() {
  set<char> gen;
  string TEMP;
  vector<string> types;
  for (int i = 0; i < (int((words).size())); i++) {
    TEMP = typeOf(words[i]);
    types.push_back(TEMP);
    gen.insert(TEMP[0]);
    if (TEMP[0] == '-') return false;
  }
  if ((int((gen).size())) > 1) return false;
  int good = 0;
  int noun = 0;
  for (int i = 0; i < (int((words).size())); i++)
    if (types[i].substr(1) == "noun") {
      bool fine = true;
      noun++;
      for (int j = 0; j < i; j++)
        if (types[j].substr(1) != "adj") fine = false;
      for (int j = i + 1; j < (int((words).size())); j++)
        if (types[j].substr(1) != "verb") fine = false;
      if (fine) good++;
    }
  return good == 1 && noun == 1;
}
int main() {
  string line, temp;
  while (getline(cin, line)) {
    words.clear();
    is.clear();
    is.str(line);
    while (is >> temp) words.push_back(temp);
    bool fine = false;
    if ((int((words).size())) == 1) {
      string test = typeOf(words[0]);
      if (test[0] != '-') fine = true;
    }
    if (ok() || fine)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
