#include <bits/stdc++.h>
using namespace std;
bool endswith(const string& word, const string& suf) {
  return word.size() >= suf.size() &&
         word.substr(word.size() - suf.size()) == suf;
}
bool is_noun(const string& word) {
  return endswith(word, "etr") || endswith(word, "etra");
}
bool is_adjective(const string& word) {
  return endswith(word, "lios") || endswith(word, "liala");
}
bool is_verb(const string& word) {
  return endswith(word, "initis") || endswith(word, "inites");
}
bool is_man(const string& word) {
  return endswith(word, "etr") || endswith(word, "lios") ||
         endswith(word, "initis");
}
bool is_woman(const string& word) {
  return endswith(word, "etra") || endswith(word, "liala") ||
         endswith(word, "inites");
}
bool is_word(const string& word) {
  return is_noun(word) || is_adjective(word) || is_verb(word);
}
bool is_ordered(const vector<int>& a) {
  for (int i = 0; i + 1 < a.size(); ++i) {
    if (a[i] > a[i + 1]) {
      return false;
    }
  }
  return true;
}
int main() {
  string s;
  getline(cin, s);
  stringstream ss(s);
  vector<string> words;
  string word;
  while (ss >> word) {
    words.push_back(word);
  }
  bool res = true;
  if (words.size() == 1) {
    if (!is_word(words[0])) {
      res = false;
    }
  } else {
    vector<int> t(words.size());
    vector<int> r(words.size());
    for (int i = 0; i < words.size(); ++i) {
      if (!is_word(words[i])) {
        res = false;
      } else {
        if (is_adjective(words[i])) {
          t[i] = 0;
        } else if (is_noun(words[i])) {
          t[i] = 1;
        } else {
          t[i] = 2;
        }
        if (is_man(words[i])) {
          r[i] = 0;
        } else {
          r[i] = 1;
        }
      }
    }
    if (!is_ordered(t) || count(t.begin(), t.end(), 1) != 1) {
      res = false;
    }
    if (count(r.begin(), r.end(), 0) != r.size() &&
        count(r.begin(), r.end(), 0) != 0) {
      res = false;
    }
  }
  if (res) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
