#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const double PI =
    3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862;
const int inf_int = 1e9 + 5;
const ll inf_ll = 1e18 + 5;
const int NMax = 1e3 + 5;
const int mod = 1e9 + 7;
const int dx[4] = {-1, 0, 0, +1}, dy[4] = {0, -1, +1, 0};
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  string str;
  cin >> str;
  int nrNouns = 0, nrWords = 0;
  bool adjAfterNoun = false, verbBeforeNoun = false, haveMasc = false,
       haveFem = false, junkWords = false;
  while (!cin.fail()) {
    ++nrWords;
    int N = str.size();
    if (N >= 4 && str.substr(N - 4) == "lios") {
      haveMasc = true;
      if (nrNouns != 0) {
        adjAfterNoun = true;
      }
    } else if (N >= 5 && str.substr(N - 5) == "liala") {
      haveFem = true;
      if (nrNouns != 0) {
        adjAfterNoun = true;
      }
    } else if (N >= 3 && str.substr(N - 3) == "etr") {
      ++nrNouns;
      haveMasc = true;
    } else if (N >= 4 && str.substr(N - 4) == "etra") {
      ++nrNouns;
      haveFem = true;
    } else if (N >= 6 && str.substr(N - 6) == "initis") {
      haveMasc = true;
      if (nrNouns == 0) {
        verbBeforeNoun = true;
      }
    } else if (N >= 6 && str.substr(N - 6) == "inites") {
      haveFem = true;
      if (nrNouns == 0) {
        verbBeforeNoun = true;
      }
    } else {
      junkWords = true;
    }
    cin >> str;
  }
  if (nrWords == 1 && !junkWords) {
    cout << "YES\n";
  } else if (junkWords || nrNouns != 1 || adjAfterNoun || verbBeforeNoun ||
             (haveMasc && haveFem)) {
    cout << "NO\n";
  } else {
    cout << "YES\n";
  }
  return 0;
}
