#include <bits/stdc++.h>
using namespace std;
const int maxn = 100100;
char buf[maxn];
vector<string> t;
bool issuf(string a, string b) {
  return a.length() <= b.length() && b.substr(b.length() - a.length()) == a;
}
string f(string s) {
  if (issuf("lios", s))
    return "ma";
  else if (issuf("liala", s))
    return "fa";
  else if (issuf("etr", s))
    return "mn";
  else if (issuf("etra", s))
    return "fn";
  else if (issuf("initis", s))
    return "mv";
  else if (issuf("inites", s))
    return "fv";
  else
    return "bb";
}
void endit(bool ok) {
  if (ok)
    printf("YES\n");
  else
    printf("NO\n");
  exit(0);
}
int noun() {
  int cnt = 0;
  for (int(i) = 0; (i) < int(t.size()); (i)++)
    if (t[i][1] == 'n') cnt++;
  if (cnt != 1) endit(0);
  for (int(i) = 0; (i) < int(t.size()); (i)++)
    if (t[i][1] == 'n') return i;
}
int main() {
  while (scanf("%s", buf) != EOF) {
    int n = strlen(buf);
    int offset = n - 7;
    if (offset < 0) offset = 0;
    t.push_back(f(&buf[offset]));
    ;
  }
  for (int(i) = 0; (i) < int(t.size()); (i)++)
    if (t[i][0] == 'b') endit(0);
  if (t.size() == 1) endit(1);
  for (int(i) = 0; (i) < int(t.size() - 1); (i)++)
    if (t[i][0] != t[i + 1][0]) endit(0);
  int j = noun();
  for (int(i) = 0; (i) < int(j); (i)++)
    if (t[i][1] != 'a') endit(0);
  for (int(i) = (j + 1); (i) <= (t.size() - 1); (i)++)
    if (t[i][1] != 'v') endit(0);
  endit(1);
  return 0;
}
