#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", 3, "inline")
using namespace std;
string s;
string c[10] = {"lios", "liala", "etr", "etra", "initis", "inites"};
int ff = 1;
int m, n, l = -1, ll;
int main() {
  ios_base::sync_with_stdio(false);
  while (cin >> s)
    if (ff) {
      m++;
      ll = -1;
      for (int i = 0; i < 6; i++) {
        if (c[i].size() <= s.size()) {
          string ss = s.substr(s.size() - c[i].size(), c[i].size());
          if (ss == c[i]) {
            ll = i;
            break;
          }
        }
      }
      if (ll == 2 || ll == 3) n++;
      if (ll == -1 || (l >= 0 && ll % 2 != l % 2) || ll < l)
        ff = 0;
      else
        l = ll;
    }
  if (ff && (n == 1 || m == 1))
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
