#include <bits/stdc++.h>
using namespace std;
unordered_map<string, string> mapping;
void solve() {
  mapping["soil"] = "ma", mapping["alail"] = "fa", mapping["rte"] = "mn",
  mapping["arte"] = "fn", mapping["sitini"] = "mv", mapping["setini"] = "fv";
  string s;
  vector<string> v;
  while (cin >> s) {
    reverse(s.begin(), s.end());
    v.push_back(s);
  }
  int noun = 0, male = 0, female = 0, nounNumber = -1, number = 0;
  vector<int> adj, verb;
  for (const auto& it : v) {
    string t = "";
    bool ok = true;
    for (int i = 0; i < min(6, (int)it.size()); i++) {
      t += it[i];
      if (mapping.find(t) != mapping.end()) {
        ok = false;
        string x = mapping[t];
        if (x[0] == 'f')
          female++;
        else
          male++;
        if (x[1] == 'a')
          adj.push_back(number);
        else if (x[1] == 'v')
          verb.push_back(number);
        else
          noun++, nounNumber = number;
        number++;
        break;
      }
    }
    if (ok) {
      cout << "NO\n";
      return;
    }
  }
  if (noun + adj.size() + verb.size() == 1) {
    cout << "YES\n";
    return;
  }
  if ((male && female) || noun != 1) {
    cout << "NO\n";
    return;
  }
  for (int it : adj) {
    if (it > nounNumber) {
      cout << "NO\n";
      return;
    }
  }
  for (auto it : verb) {
    if (it < nounNumber) {
      cout << "NO\n";
      return;
    }
  }
  cout << "YES\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int tc = 1;
  while (tc--) {
    solve();
  }
  return 0;
}
