#include <bits/stdc++.h>
using namespace std;
bool endsWith(string s, string w) {
  int p = s.length() - w.length();
  if (p < 0) return false;
  for (int i = 0; i < w.length(); ++i)
    if (s[p + i] != w[i]) return false;
  return true;
}
int main() {
  string s;
  getline(cin, s);
  s += ' ';
  vector<int> seq;
  while (s.length()) {
    int p = s.find(' ');
    string ns = s.substr(0, p);
    s.erase(0, p + 1);
    if (endsWith(ns, "lios"))
      seq.push_back(1);
    else if (endsWith(ns, "liala"))
      seq.push_back(2);
    else if (endsWith(ns, "etr"))
      seq.push_back(3);
    else if (endsWith(ns, "etra"))
      seq.push_back(4);
    else if (endsWith(ns, "initis"))
      seq.push_back(5);
    else if (endsWith(ns, "inites"))
      seq.push_back(6);
    else {
      cout << "NO" << endl;
      return 0;
    }
  }
  if (seq.size() > 1) {
    int p = 0, t = seq[0] & 1;
    while (p < seq.size() && seq[p] == 2 - t) ++p;
    if (p == seq.size()) {
      cout << "NO" << endl;
      return 0;
    }
    if (seq[p++] != 4 - t) {
      cout << "NO" << endl;
      return 0;
    }
    while (p < seq.size() && seq[p] == 6 - t) ++p;
    if (p != seq.size()) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
