#include <bits/stdc++.h>
using namespace std;
string endings[2][3] = {{"lios", "etr", "initis"}, {"liala", "etra", "inites"}};
bool parse();
bool setGender();
bool isAdjective();
bool isNoun();
bool isVerb();
int gender;
void getToken();
string currentToken;
stack<string> sentence;
int main(void) {
  while (cin >> currentToken) sentence.push(currentToken);
  if (parse())
    cout << "YES" << '\n';
  else
    cout << "NO" << '\n';
  return 0;
}
bool parse() {
  if (!setGender()) return false;
  if (sentence.size() == 1) return true;
  while (isVerb()) sentence.pop();
  if (!isNoun()) return false;
  sentence.pop();
  while (isAdjective()) sentence.pop();
  if (sentence.size() > 0) return false;
  return true;
}
bool setGender() {
  if ((sentence.top().length() >= endings[0][0].length() &&
       sentence.top().rfind(endings[0][0]) ==
           sentence.top().length() - endings[0][0].length()) ||
      (sentence.top().length() >= endings[0][1].length() &&
       sentence.top().rfind(endings[0][1]) ==
           sentence.top().length() - endings[0][1].length()) ||
      (sentence.top().length() >= endings[0][2].length() &&
       sentence.top().rfind(endings[0][2]) ==
           sentence.top().length() - endings[0][2].length()))
    gender = 0;
  else if ((sentence.top().length() >= endings[1][0].length() &&
            sentence.top().rfind(endings[1][0]) ==
                sentence.top().length() - endings[1][0].length()) ||
           (sentence.top().length() >= endings[1][1].length() &&
            sentence.top().rfind(endings[1][1]) ==
                sentence.top().length() - endings[1][1].length()) ||
           (sentence.top().length() >= endings[1][2].length() &&
            sentence.top().rfind(endings[1][2]) ==
                sentence.top().length() - endings[1][2].length()))
    gender = 1;
  else
    return false;
  return true;
}
bool isAdjective() {
  if (sentence.size() == 0 ||
      sentence.top().length() < endings[gender][0].length())
    return false;
  if (sentence.top().rfind(endings[gender][0]) ==
      sentence.top().length() - endings[gender][0].length())
    return true;
  else
    return false;
}
bool isNoun() {
  if (sentence.size() == 0 ||
      sentence.top().length() < endings[gender][1].length())
    return false;
  if (sentence.top().rfind(endings[gender][1]) ==
      sentence.top().length() - endings[gender][1].length())
    return true;
  else
    return false;
}
bool isVerb() {
  if (sentence.size() == 0 ||
      sentence.top().length() < endings[gender][2].length())
    return false;
  if (sentence.top().rfind(endings[gender][2]) ==
      sentence.top().length() - endings[gender][2].length())
    return true;
  else
    return false;
}
