#include <bits/stdc++.h>
int IntMaxVal = (int)1e20;
int IntMinVal = (int)-1e20;
long long LongMaxVal = (long long)1e20;
long long LongMinVal = (long long)-1e20;
using namespace std;
template <typename T>
struct argument_type;
template <typename T, typename U>
struct argument_type<T(U)> {};
template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& s) {
  is >> s.first >> s.second;
  return is;
}
bool hasEnding(std::string const& fullString, std::string const& ending) {
  if (fullString.length() >= ending.length()) {
    return (0 == fullString.compare(fullString.length() - ending.length(),
                                    ending.length(), ending));
  } else {
    return false;
  }
}
const int ADJECTIVE = 1;
const int NOUN = 2;
const int VERB = 3;
bool check() {
  vector<pair<int, bool> > words;
  string s;
  while (cin >> s) {
    if (hasEnding(s, "lios"))
      words.push_back(make_pair(ADJECTIVE, true));
    else if (hasEnding(s, "liala"))
      words.push_back(make_pair(ADJECTIVE, false));
    else if (hasEnding(s, "etr"))
      words.push_back(make_pair(NOUN, true));
    else if (hasEnding(s, "etra"))
      words.push_back(make_pair(NOUN, false));
    else if (hasEnding(s, "initis"))
      words.push_back(make_pair(VERB, true));
    else if (hasEnding(s, "inites"))
      words.push_back(make_pair(VERB, false));
    else
      return false;
  }
  if (words.size() == 1) return true;
  bool sx = words.front().second;
  for (auto p : words)
    if (p.second != sx) return false;
  int i = 0;
  while (i < words.size() && words[i].first == ADJECTIVE) i++;
  if (i == words.size() || words[i].first != NOUN) return false;
  i++;
  while (i < words.size() && words[i].first == VERB) i++;
  return i == words.size();
}
int main() {
  srand(time(NULL));
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  auto res = check();
  if (res)
    cout << "YES";
  else
    cout << "NO";
}
