#include <bits/stdc++.h>
using namespace std;
char danci[100005];
int panduan() {
  char aa[50], k;
  int len = strlen(danci), i;
  if (len < 3) return 0;
  k = 0;
  for (i = len - 4; i <= len; i++) aa[k++] = danci[i];
  if (strcmp(aa, "lios") == 0) return 1;
  k = 0;
  for (i = len - 5; i <= len; i++) aa[k++] = danci[i];
  if (strcmp(aa, "liala") == 0) return 2;
  k = 0;
  for (i = len - 3; i <= len; i++) aa[k++] = danci[i];
  if (strcmp(aa, "etr") == 0) return 3;
  k = 0;
  for (i = len - 4; i <= len; i++) aa[k++] = danci[i];
  if (strcmp(aa, "etra") == 0) return 4;
  k = 0;
  for (i = len - 6; i <= len; i++) aa[k++] = danci[i];
  if (strcmp(aa, "initis") == 0) return 5;
  k = 0;
  for (i = len - 6; i <= len; i++) aa[k++] = danci[i];
  if (strcmp(aa, "inites") == 0) return 6;
  return 0;
}
int main() {
  char sss[100005];
  int jilu[100005];
  while (gets(sss)) {
    int tp = 0, flag = 1, i;
    int len = strlen(sss), t, l = 0, gs = 0;
    for (i = 0; i <= len; i++) {
      if (sss[i] != ' ' && sss[i] != '\0') {
        danci[l++] = sss[i];
      } else {
        gs++;
        danci[l] = '\0';
        t = panduan();
        if (t != 0)
          jilu[tp++] = t;
        else {
          flag = 0;
        }
      }
    }
    if (gs == 1 && flag == 1) {
      puts("YES");
      continue;
    }
    if (flag == 0) {
      puts("NO");
      continue;
    }
    gs = 0;
    for (i = 0; i < tp; i++)
      if (jilu[i] == 3 || jilu[i] == 4) gs++;
    if (gs != 1) {
      puts("NO");
      continue;
    }
    flag = 1;
    if (jilu[0] % 2) {
      for (i = 1; i < tp; i++)
        if (jilu[i] % 2 == 0) {
          flag = 0;
          break;
        }
    } else {
      for (i = 1; i < tp; i++)
        if (jilu[i] % 2) {
          flag = 0;
          break;
        }
    }
    if (flag == 0) {
      puts("NO");
      continue;
    }
    flag = 1;
    for (i = 1; i < tp; i++) {
      if (jilu[i] < jilu[i - 1]) {
        flag = 0;
        break;
      }
    }
    if (flag)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
