#include <bits/stdc++.h>
using namespace std;
const double inf = 1e100;
const int iinf = 1 << 30;
const int MAX = 10000010;
int a[MAX];
struct word {
  int sex;
  int part;
};
vector<word> v;
word get(string s) {
  word res;
  res.sex = -1;
  res.part = -1;
  int n = s.length();
  if (s.length() > 2 && s.substr(n - 3, 3) == "etr") {
    res.sex = 0;
    res.part = 1;
  }
  if (s.length() > 3 && s.substr(n - 4, 4) == "lios") {
    res.sex = 0;
    res.part = 0;
  }
  if (s.length() > 4 && s.substr(n - 5, 5) == "liala") {
    res.sex = 1;
    res.part = 0;
  }
  if (s.length() > 3 && s.substr(n - 4, 4) == "etra") {
    res.sex = 1;
    res.part = 1;
  }
  if (s.length() > 5 && s.substr(n - 6, 6) == "initis") {
    res.sex = 0;
    res.part = 2;
  }
  if (s.length() > 5 && s.substr(n - 6, 6) == "inites") {
    res.sex = 1;
    res.part = 2;
  }
  return res;
}
int main() {
  bool ok = true;
  string s;
  bool has = false;
  while (cin >> s) {
    word w = get(s);
    if (w.sex < 0) {
      ok = false;
      break;
    }
    if (has && w.part == 1) ok = false;
    has = has || w.part == 1;
    v.push_back(w);
  }
  for (int i = 1; i < v.size(); ++i) {
    ok = ok && (v[i].part >= v[i - 1].part);
    ok = ok && v[i].sex == v[i - 1].sex;
  }
  if (ok && (has || v.size() == 1))
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
