#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int cfv = 0, cmv = 0, cn = 0, cmn = 0, cfn = 0, ans = 1, cma = 0, cfa = 0;
  while (cin >> s) {
    string p, t;
    cn++;
    int f = 0;
    for (int i = max((int)s.size() - 6, 0); i < s.size(); i++) {
      p += s[i];
    }
    if (p == "inites")
      cfv = cn, f = 1;
    else if (p == "initis")
      cmv = cn, f = 1;
    p = "";
    for (int i = max((int)s.size() - 5, 0); i < s.size(); i++) {
      p += s[i];
    }
    if (p == "liala" && (!cfn && !cfv)) cfa = cn, f = 1;
    p = "";
    for (int i = max((int)s.size() - 4, 0); i < s.size(); i++) {
      p += s[i];
    }
    if (p == "etra" && (cfn || cfv))
      f = 0;
    else if (p == "lios" && (!cfn && !cfv))
      cma = cn, f = 1;
    else if (p == "etra")
      cfn = cn, f = 1;
    p = "";
    for (int i = max((int)s.size() - 3, 0); i < s.size(); i++) {
      p += s[i];
    }
    if (p == "etr" && (cmn || cmv))
      f = 0;
    else if (p == "etr")
      cmn = cn, f = 1;
    if (!f) ans = 0;
  }
  if (ans) {
    if (cn == 1)
      ans = 1;
    else if (((cfa < cfn)) && ((cfn < cfv) || cfv == 0) && !cmn && !cma && !cmv)
      ans = 1;
    else if (((cma < cmn)) && ((cmn < cmv) || cmv == 0) && !cfa && !cfn && !cfv)
      ans = 1;
    else
      ans = 0;
  }
  if (ans)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
