#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
int a, b, c, d, i, j, n, m, k;
vector<string> words;
string s;
int mas[200001];
inline void die() {
  printf("NO\n");
  exit(0);
}
inline string suff(const string& s, int num) {
  if ((int)((s).size()) < num) return "";
  return s.substr((int)((s).size()) - num, num);
}
inline 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 _n(((int)((words).size())) - 1), i(0); i <= _n; i++) {
    int a = word(words[i]);
    if (a == -1) die();
    mas[i] = a;
  }
  if ((int)((words).size()) > 1) {
    a = 0;
    for (int _n(((int)((words).size())) - 1), i(0); i <= _n; i++) {
      if (mas[i] % 2 == 0) a |= 1;
      if (mas[i] % 2 == 1) a |= 2;
    }
    if (a == 3) die();
    for (int _n(((int)((words).size())) - 1), i(0); i <= _n; i++) mas[i] /= 2;
    a = 0;
    while (a < (int)((words).size()) && mas[a] == 0) ++a;
    if (a == (int)((words).size())) die();
    if (mas[a] != 1) die();
    ++a;
    if (a < (int)((words).size()) && mas[a] == 1) die();
    while (a < (int)((words).size()) && mas[a] == 2) ++a;
    if (a != (int)((words).size())) die();
  }
  printf("YES\n");
}
