#include <bits/stdc++.h>
using namespace std;
bool isMnoun(string s) {
  return s.size() >= 3 && s.substr(s.size() - 3) == "etr";
}
bool isFnoun(string s) {
  return s.size() >= 4 && s.substr(s.size() - 4) == "etra";
}
bool isMverb(string s) {
  return s.size() >= 6 && s.substr(s.size() - 6) == "initis";
}
bool isFverb(string s) {
  return s.size() >= 6 && s.substr(s.size() - 6) == "inites";
}
bool isMadje(string s) {
  return s.size() >= 4 && s.substr(s.size() - 4) == "lios";
}
bool isFadje(string s) {
  return s.size() >= 5 && s.substr(s.size() - 5) == "liala";
}
int main() {
  ios_base::sync_with_stdio(0);
  string in;
  while (getline(cin, in)) {
    istringstream is(in);
    string s;
    vector<string> v;
    while (is >> s) v.push_back(s);
    if (v.size() == 1) {
      if (isMadje(v[0]) || isMnoun(v[0]) || isMverb(v[0]) || isFadje(v[0]) ||
          isFnoun(v[0]) || isFverb(v[0]))
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
      continue;
    }
    int i = 0;
    while (i < v.size() && isMadje(v[i])) i++;
    bool ok = (i < v.size() && isMnoun(v[i]));
    i++;
    while (i < v.size() && isMverb(v[i])) i++;
    if (ok && i == v.size()) {
      cout << "YES" << endl;
      continue;
    }
    i = 0;
    while (i < v.size() && isFadje(v[i])) i++;
    ok = (i < v.size() && isFnoun(v[i]));
    i++;
    while (i < v.size() && isFverb(v[i])) i++;
    if (ok && i == v.size()) {
      cout << "YES" << endl;
      continue;
    }
    cout << "NO" << endl;
  }
  return 0;
}
