#include <bits/stdc++.h>
using namespace std;
string ci[3] = {"liala", "etra", "inites"};
string xo[3] = {"lios", "etr", "initis"};
string ad[3] = {"liala", "lios"};
string no[3] = {"etra", "etr"};
string ve[3] = {"inites", "initis"};
vector<bool> a(100011);
vector<int> x(100011);
bool cx(string j) {
  for (int i = 0; i < 3; i++) {
    if (j.size() < ci[i].size()) continue;
    string e = j.substr(j.size() - ci[i].size());
    if (e == ci[i]) return 0;
  }
  for (int i = 0; i < 3; i++) {
    if (j.size() < xo[i].size()) continue;
    string e = j.substr(j.size() - xo[i].size());
    if (e == xo[i]) return 1;
  }
  return 0;
}
bool co(string j) {
  for (int i = 0; i < 2; i++) {
    if (j.size() < ad[i].size()) continue;
    string e = j.substr(j.size() - ad[i].size());
    if (e == ad[i]) return 0;
  }
  for (int i = 0; i < 2; i++) {
    if (j.size() < no[i].size()) continue;
    string e = j.substr(j.size() - no[i].size());
    if (e == no[i]) return 1;
  }
  for (int i = 0; i < 2; i++) {
    if (j.size() < ve[i].size()) continue;
    string e = j.substr(j.size() - ve[i].size());
    if (e == ve[i]) return 2;
  }
  return -1;
}
int main() {
  string c;
  string h;
  getline(cin, h);
  istringstream sin(h);
  int n = 0;
  int i = 0;
  for (; sin >> c; i++) {
    x[i] = co(c);
    a[i] = cx(c);
    if (x[i] == 1) n++;
    if (x[i] == -1) {
      puts("NO");
      return 0;
    }
    cout << c;
  }
  if (n != 1) {
    puts("NO");
    return 0;
  }
  bool ok = a[0];
  for (int j = 0; j < i; j++)
    if (a[j] != a[0]) {
      puts("NO");
      return 0;
    }
  int j = 0;
  while (x[i] == 0 && i < x.size()) j++;
  while (x[i] == 1 && i < x.size()) j++;
  while (x[i] == 2 && i < x.size()) j++;
  if (j < i - 1) {
    puts("NO");
    return 0;
  }
  puts("YES");
  return 0;
}
