#include <bits/stdc++.h>
using namespace std;
int a, b, c, d, i, j, n, m, k;
vector<string> words;
string s;
int mas[200001];
void die() {
  cout << "NO";
  exit(0);
}
string suff(const string s, int num) {
  if (s.size() < num) return "";
  return s.substr(s.size() - num, num);
}
int word(string s) {
  if (suff(s, 3) == "etr")
    return 2;
  else if (suff(s, 4) == "etra")
    return 3;
  else if (suff(s, 4) == "lios")
    return 0;
  else if (suff(s, 5) == "liala")
    return 1;
  else if (suff(s, 6) == "initis")
    return 4;
  else if (suff(s, 6) == "inites")
    return 5;
  else
    return -1;
}
int main() {
  while (cin >> s) words.push_back(s);
  for (int i = 0; i < words.size(); i++) {
    int a = word(words[i]);
    if (a == -1) die();
    mas[i] = a;
  }
  if (words.size() > 1) {
    a = 0;
    for (int i = 0; i < words.size(); i++) {
      if (mas[i] % 2 == 0) a |= 1;
      if (mas[i] % 2 == 1) a |= 2;
    }
    if (a == 3) die();
    for (int i = 0; i < words.size(); i++) mas[i] /= 2;
    a = 0;
    while (a < words.size() && mas[a] == 0) a++;
    if (a == words.size()) die();
    if (mas[a] != 1) die();
    a++;
    if (a < words.size() && mas[a] == 1) die();
    while (a < words.size() && mas[a] == 2) a++;
    if (a != words.size()) die();
  }
  cout << "YES";
  return 0;
}
