#include <bits/stdc++.h>
using namespace std;
string s;
vector<string> p;
int n = 0, i;
bool m() {
  for (i = 0; i < n && p[i].find("soil") == 0; ++i)
    ;
  if (i == n || p[i].find("rte") != 0) return false;
  for (++i; i < n && p[i].find("sitini") == 0; ++i)
    ;
  return i == n;
}
bool f() {
  for (i = 0; i < n && p[i].find("alail") == 0; ++i)
    ;
  if (i == n || p[i].find("arte") != 0) return false;
  for (++i; i < n && p[i].find("setini") == 0; ++i)
    ;
  return i == n;
}
bool g() {
  i = 0;
  if (n == 1)
    return p[i].find("soil") == 0 || p[i].find("rte") == 0 ||
           p[i].find("sitini") == 0 || p[i].find("alail") == 0 ||
           p[i].find("arte") == 0 || p[i].find("setini") == 0;
  if (n > 1) return m() || f();
}
int main() {
  while (cin >> s) {
    reverse(s.begin(), s.end());
    p.push_back(s);
    ++n;
  }
  cout << (g() ? "YES" : "NO");
  return 0;
}
