#include <bits/stdc++.h>
using namespace std;
string s;
string a[110000];
int ca(string p) {
  int l = p.size();
  string q = "";
  for (int i = l - 4; i < l; i++) q += p[i];
  if (q == "lios") return 1;
  q = p[l - 5] + q;
  if (q == "liala") return -1;
  return 0;
}
int cn(string p) {
  int l = p.size();
  string q = "";
  for (int i = l - 3; i < l; i++) q += p[i];
  if (q == "etr") return 1;
  q = p[l - 4] + q;
  if (q == "etra") return -1;
  return 0;
}
int cv(string p) {
  int l = p.size();
  string q = "";
  for (int i = l - 6; i < l; i++) q += p[i];
  if (q == "initis") return 1;
  if (q == "inites") return -1;
  return 0;
}
int main() {
  getline(cin, s);
  int k = 1;
  for (unsigned int i = 0; i < s.size(); i++) {
    if (s[i] == ' ')
      k++;
    else
      a[k] += s[i];
  }
  if (k == 1) {
    if (ca(a[1]) != 0 || cv(a[1]) != 0 || cn(a[1]) != 0)
      printf("YES\n");
    else
      printf("NO\n");
    return 0;
  }
  int last = ca(a[1]);
  int i = 1;
  if (last != 0) {
    for (i = 2; i <= k; i++) {
      int tmp = ca(a[i]);
      if (tmp == 0)
        break;
      else if (tmp != last) {
        printf("NO\n");
        return 0;
      }
    }
  }
  if ((last != 0 && cn(a[i]) != last) || cn(a[i]) == 0) {
    printf("NO\n");
    return 0;
  }
  last = cn(a[i]);
  for (int j = i + 1; j <= k; j++)
    if (cv(a[j]) != last) {
      printf("NO\n");
      return 0;
    }
  printf("YES\n");
  return 0;
}
