#include <bits/stdc++.h>
using namespace std;
char Gadj(string cad) {
  if (cad.size() < 4) return 'X';
  string ul;
  if (cad.size() >= 5) {
    ul = cad.substr(cad.size() - 4, 4);
    if (ul == "lios") return 'm';
    ul = cad.substr(cad.size() - 5, 5);
    if (ul == "liala") return 'f';
  } else if (cad.size() == 4) {
    ul = cad.substr(cad.size() - 4, 4);
    if (ul == "lios") return 'm';
  }
  return 'X';
}
char Gnoun(string cad) {
  if (cad.size() < 3) return 'X';
  string ul;
  if (cad.size() >= 4) {
    ul = cad.substr(cad.size() - 3, 3);
    if (ul == "etr") return 'm';
    ul = cad.substr(cad.size() - 4, 4);
    if (ul == "etra") return 'f';
  } else if (cad.size() == 3) {
    ul = cad.substr(cad.size() - 3, 3);
    if (ul == "etr") return 'm';
  }
  return 'X';
}
char Gverb(string cad) {
  if (cad.size() < 6) return 'X';
  string ul;
  if (cad.size() >= 6) {
    ul = cad.substr(cad.size() - 6, 6);
    if (ul == "initis") return 'm';
    ul = cad.substr(cad.size() - 6, 6);
    if (ul == "inites") return 'f';
  }
  return 'X';
}
int main() {
  vector<string> v;
  string cad;
  while (cin >> cad) {
    v.push_back(cad);
  }
  int no = 0;
  int f = 0;
  int m = 0;
  bool valid = true;
  vector<int> aj;
  vector<int> ver;
  if (v.size() == 1) {
    if (Gnoun(v[0]) != 'X' || Gadj(v[0]) != 'X' || Gverb(v[0]) != 'X')
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
    return 0;
  }
  int inno = -1;
  for (int i = 0; i < v.size(); i++) {
    if (Gnoun(v[i]) != 'X') {
      if (Gnoun(v[i]) == 'f')
        f++;
      else
        m++;
      inno = i;
      no++;
    } else if (Gadj(v[i]) != 'X') {
      if (Gadj(v[i]) == 'f')
        f++;
      else
        m++;
      aj.push_back(i);
    } else if (Gverb(v[i]) != 'X') {
      if (Gverb(v[i]) == 'f')
        f++;
      else
        m++;
      ver.push_back(i);
    } else
      valid = false;
  }
  if (!valid)
    cout << "NO" << endl;
  else if (no != 1)
    cout << "NO" << endl;
  else if (m != 0 && f != 0)
    cout << "NO" << endl;
  else {
    sort((aj).begin(), (aj).end());
    sort((ver).begin(), (ver).end());
    int aa, bb;
    if (aj.size() == 0)
      aa = -1;
    else
      aa = aj[aj.size() - 1];
    if (ver.size() == 0)
      bb = 100000000;
    else
      bb = ver[0];
    if (aa < inno && inno < bb)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
