#include <bits/stdc++.h>
using namespace std;
int n;
int s[100050];
bool g[100050];
inline string sub(const string &t, int x) {
  x = -x;
  if (t.length() < x) return "";
  return t.substr(t.length() - x);
}
inline bool rec(string t) {
  if (sub(t, -4) == "lios")
    s[n] = 0, g[n] = 0;
  else if (sub(t, -5) == "liala")
    s[n] = 0, g[n] = 1;
  else if (sub(t, -3) == "etr")
    s[n] = 1, g[n] = 0;
  else if (sub(t, -4) == "etra")
    s[n] = 1, g[n] = 1;
  else if (sub(t, -6) == "initis")
    s[n] = 2, g[n] = 0;
  else if (sub(t, -6) == "inites")
    s[n] = 2, g[n] = 1;
  else
    return 0;
  n++;
  return 1;
}
inline bool check() {
  int i, m;
  if (n == 1) return 1;
  for (int i = 1; i < n; i++)
    if (g[i] != g[i - 1]) return 0;
  for (m = 0; m < n; m++)
    if (s[m] == 1) break;
  if (m == n) return 0;
  for (i = 0; i < m; i++)
    if (s[i] != 0) return 0;
  for (i = m + 1; i < n; i++)
    if (s[i] != 2) return 0;
  return 1;
}
int main(void) {
  int i;
  string t;
  n = 0;
  while (cin >> t) {
    if (!rec(t)) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << (check() ? "YES\n" : "NO\n");
}
