#include <bits/stdc++.h>
using namespace std;
const int maxn = 2 * 1000 * 100 + 1000;
string a[maxn];
inline bool find(string x, string y) {
  if (x.size() < y.size()) return false;
  if (x.substr(x.size() - y.size()) == y)
    return true;
  else
    return false;
}
inline bool female(string x) {
  return (find(x, "liala") || find(x, "etra") || find(x, "inites"));
}
inline bool male(string x) {
  return (find(x, "lios") || find(x, "etr") || find(x, "initis"));
}
inline bool adj(string x) { return (find(x, "liala") || find(x, "lios")); }
inline bool name(string x) { return find(x, "etra") || find(x, "etr"); }
inline bool verb(string x) { return find(x, "inites") || find(x, "initis"); }
int main() {
  string inp;
  getline(cin, inp);
  stringstream ss(inp);
  string cur;
  int n = 0;
  while (ss >> cur) {
    a[n++] = cur;
  }
  bool fe = female(a[0]);
  for (int i = 0; i < n; i++)
    if (!female(a[i]) && !male(a[i]) || female(a[i]) != fe) {
      cout << "NO" << endl;
      return 0;
    }
  if (n == 1) {
    cout << "YES" << endl;
    return 0;
  }
  bool ok = true;
  int ind = 0;
  {
    while (ind < n && adj(a[ind])) ind++;
    if (ind == n || !name(a[ind])) {
      ok = false;
    } else
      ind++;
    while (ind < n && verb(a[ind])) ind++;
  }
  if (ind < n) ok = false;
  if (ok)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
