#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, s1;
  vector<int> chast;
  vector<bool> rod;
  getline(cin, s);
  istringstream ss(s);
  bool st = true;
  while (!ss.eof()) {
    ss >> s1;
    if (s1.length() >= 4 && s1.substr(s1.length() - 4, 4) == "lios") {
      chast.push_back(0);
      rod.push_back(true);
      continue;
    }
    if (s1.length() >= 5 && s1.substr(s1.length() - 5, 5) == "liala") {
      chast.push_back(0);
      rod.push_back(false);
      continue;
    }
    if (s1.length() >= 3 && s1.substr(s1.length() - 3, 3) == "etr") {
      chast.push_back(1);
      rod.push_back(true);
      continue;
    }
    if (s1.length() >= 4 && s1.substr(s1.length() - 4, 4) == "etra") {
      chast.push_back(1);
      rod.push_back(false);
      continue;
    }
    if (s1.length() >= 6 && s1.substr(s1.length() - 6, 6) == "initis") {
      chast.push_back(2);
      rod.push_back(true);
      continue;
    }
    if (s1.length() >= 6 && s1.substr(s1.length() - 6, 6) == "inites") {
      chast.push_back(2);
      rod.push_back(false);
      continue;
    }
    st = false;
  }
  for (int i = 1; i < rod.size(); i++)
    if (rod[i] != rod[i - 1]) {
      st = false;
      break;
    }
  if (chast.size() > 1) {
    int j = 0;
    for (; j < chast.size(); j++)
      if (chast[j] != 0) break;
    if (j >= chast.size() || chast[j] != 1)
      st = false;
    else {
      j++;
      for (; j < chast.size(); j++)
        if (chast[j] != 2) break;
      if (j < chast.size()) st = false;
    }
  }
  cout << (st ? "YES" : "NO");
  int n;
  cin >> n;
}
