#include <bits/stdc++.h>
using namespace std;
const int N = 200000;
int f[N], b[N];
string a[6] = {"lios", "liala", "etr", "etra", "initis", "inites"};
string s[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int l = 0;
  int z = -1;
  while (cin >> s[l]) {
    string t = s[l];
    int p = -1;
    for (int i = 0; i < 6; i++) {
      if (t.length() >= a[i].length() &&
          t.substr(t.length() - a[i].length(), a[i].length()) == a[i]) {
        p = i;
      }
    }
    if (p == -1 || (z != -1 && p % 2 != z)) {
      cout << "NO";
      return 0;
    }
    z = p % 2;
    b[p / 2]++;
    if (b[1] > 1) {
      cout << "NO";
      return 0;
    }
    f[l] = p / 2;
    if (l != 0 && f[l] < f[l - 1]) {
      cout << "NO";
      return 0;
    }
    l++;
  }
  if (b[1] != 1 && l > 1)
    cout << "NO";
  else
    cout << "YES";
}
