#include <bits/stdc++.h>
using namespace std;
int mankind(string s) {
  if (s.size() >= 4 && s.substr(s.size() - 4, 4) == "lios") return 1;
  if (s.size() >= 3 && s.substr(s.size() - 3, 3) == "etr") return 2;
  if (s.size() >= 6 && s.substr(s.size() - 6, 6) == "initis") return 3;
  return 0;
}
int womankind(string s) {
  if (s.size() >= 5 && s.substr(s.size() - 5, 5) == "liala") return 1;
  if (s.size() >= 4 && s.substr(s.size() - 4, 4) == "etra") return 2;
  if (s.size() >= 6 && s.substr(s.size() - 6, 6) == "inites") return 3;
  return 0;
}
int main() {
  string s;
  vector<string> v;
  v.clear();
  while (cin >> s) v.push_back(s);
  if (v.size() == 1) {
    if (mankind(v[0]) == 0 && womankind(v[0]) == 0)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
    return 0;
  }
  if (mankind(v[0]) > 0) {
    int num = 0;
    int noun = 0;
    bool can = true;
    for (int(i) = 0; (i) < (v.size()); (i)++) {
      int c = mankind(v[i]);
      if (c == 0) can = false;
      if (c < num) can = false;
      if (c == 2) noun++;
      num = c;
    }
    if (can && noun == 1)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  } else {
    int num = 0;
    int noun = 0;
    bool can = true;
    for (int(i) = 0; (i) < (v.size()); (i)++) {
      int c = womankind(v[i]);
      if (c == 0) can = false;
      if (c < num) can = false;
      if (c == 2) noun++;
      num = c;
    }
    if (can && noun == 1)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
