#include <bits/stdc++.h>
using namespace std;
const float eps = 1e-9;
char _str[100050];
string str;
int main() {
  int rech = 0;
  int rod = 0;
  int treb_rech = 0;
  int treb_rod = 0;
  int res = 1;
  int sush_num = 0;
  int flag = 1;
  int slov = 0;
  while (scanf("%s", &_str) > 0) {
    str.assign(_str);
    int len = str.length();
    slov++;
    if (len >= 4 && str.substr(len - 4, 4) == "lios")
      rech = 0, rod = 1;
    else if (len >= 5 && str.substr(len - 5, 5) == "liala")
      rech = 0, rod = 0;
    else if (len >= 3 && str.substr(len - 3, 3) == "etr")
      rech = 1, rod = 1, sush_num++;
    else if (len >= 4 && str.substr(len - 4, 4) == "etra")
      rech = 1, rod = 0, sush_num++;
    else if (len >= 6 && str.substr(len - 6, 6) == "initis")
      rech = 2, rod = 1;
    else if (len >= 6 && str.substr(len - 6, 6) == "inites")
      rech = 2, rod = 0;
    else {
      res = 0;
      break;
    }
    if (flag) {
      flag = 0;
      treb_rech = rech;
      treb_rod = rod;
      continue;
    }
    if (rech < treb_rech) {
      res = 0;
      break;
    }
    if (rod != treb_rod) {
      res = 0;
      break;
    }
    if (rech == 1 && sush_num > 1) {
      res = 0;
      break;
    }
    if (rech == 2 && sush_num < 1) {
      res = 0;
      break;
    }
    treb_rech = rech;
    treb_rod = rod;
  }
  if (slov > 1 && sush_num != 1) res = 0;
  if (slov < 1) res = 0;
  if (res == 1)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
