#include <bits/stdc++.h>
using namespace std;
int cnt;
bool ism(string &s) {
  return ((s).size() >= strlen("lios") &&
          (s).substr((s).size() - strlen("lios")) == "lios") ||
         ((s).size() >= strlen("etr") &&
          (s).substr((s).size() - strlen("etr")) == "etr") ||
         ((s).size() >= strlen("initis") &&
          (s).substr((s).size() - strlen("initis")) == "initis");
}
bool isadj(string &s) {
  return ((s).size() >= strlen("lios") &&
          (s).substr((s).size() - strlen("lios")) == "lios") ||
         ((s).size() >= strlen("liala") &&
          (s).substr((s).size() - strlen("liala")) == "liala");
}
bool isnoun(string &s) {
  return ((s).size() >= strlen("etr") &&
          (s).substr((s).size() - strlen("etr")) == "etr") ||
         ((s).size() >= strlen("etra") &&
          (s).substr((s).size() - strlen("etra")) == "etra");
}
bool isverb(string &s) {
  return ((s).size() >= strlen("initis") &&
          (s).substr((s).size() - strlen("initis")) == "initis") ||
         ((s).size() >= strlen("inites") &&
          (s).substr((s).size() - strlen("inites")) == "inites");
}
bool ispetya(string &s) { return isadj(s) || isnoun(s) || isverb(s); }
bool verb(istringstream &sin, string &s, bool m) {
  if (ism(s) != m || !ispetya(s)) return false;
  if (isverb(s)) {
    if (sin >> s) {
      ++cnt;
      return verb(sin, s, m);
    }
    return true;
  }
  return false;
}
bool noun(istringstream &sin, string &s, bool m) {
  if (ism(s) != m || !ispetya(s)) return false;
  if (sin >> s) {
    ++cnt;
    return verb(sin, s, m);
  }
  return true;
}
bool adj(istringstream &sin, string &s, bool m) {
  if (ism(s) != m || !ispetya(s)) return false;
  if (isadj(s)) {
    if (sin >> s) {
      ++cnt;
      return adj(sin, s, m);
    }
    return false;
  }
  if (isnoun(s)) {
    return noun(sin, s, m);
  }
  return false;
}
int main(void) {
  string line;
  getline(cin, line);
  istringstream sin(line);
  string word;
  sin >> word;
  cnt = 1;
  if (adj(sin, word, ism(word)))
    cout << "YES" << endl;
  else if (cnt == 1 && ispetya(word)) {
    if (sin >> word)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  } else
    cout << "NO" << endl;
  return 0;
}
