#include <bits/stdc++.h>
using namespace std;
string last(string str, long long int length) {
  if (((long long int)str.size()) < length) return "";
  return str.substr(((long long int)str.size()) - length, length);
}
long long int eq(string str0, string str1) {
  return (last(str0, ((long long int)str1.size())) == str1);
}
long long int gender(string str) {
  string mas[] = {"lios", "etr", "initis"};
  string fem[] = {"liala", "etra", "inites"};
  for (long long int i = 0; i < ((long long int)(3)); i++)
    if (eq(str, mas[i])) return 1;
  for (long long int i = 0; i < ((long long int)(3)); i++)
    if (eq(str, fem[i])) return 2;
  return 0;
}
long long int grammar(string str) {
  string adj[] = {"lios", "liala"};
  string noun[] = {"etr", "etra"};
  string verb[] = {"initis", "inites"};
  for (long long int i = 0; i < ((long long int)(2)); i++)
    if (eq(str, adj[i])) return 1;
  for (long long int i = 0; i < ((long long int)(2)); i++)
    if (eq(str, noun[i])) return 2;
  for (long long int i = 0; i < ((long long int)(2)); i++)
    if (eq(str, verb[i])) return 3;
  return 0;
}
int main() {
  char line[100005];
  gets(line);
  string str;
  str = line;
  stringstream ss;
  ss << str;
  vector<string> vec;
  while (ss >> str) vec.push_back(str);
  if (((long long int)vec.size()) == 1) {
    if (gender(vec[0]))
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  } else {
    long long int state = 0;
    for (long long int i = 0;
         i < ((long long int)(((long long int)vec.size()))); i++) {
      long long int tmp = grammar(vec[i]);
      if (state == 0) {
        if (tmp == 1)
          state = 0;
        else if (tmp == 2)
          state = 1;
        else
          state = -1;
      } else if (state == 1) {
        if (tmp == 3)
          state = 2;
        else
          state = -1;
      } else if (state == 2) {
        if (tmp != 3) state = -1;
      }
    }
    long long int g = gender(vec[0]);
    if (g == 0) state = -1;
    for (long long int i = 0;
         i < ((long long int)(((long long int)vec.size()))); i++)
      if (g != gender(vec[i])) state = -1;
    if (state == -1 || state == 0)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
}
