#include <bits/stdc++.h>
using namespace std;
char Zun[100010], str[100010];
int Touhou[100010];
int Extend() {
  int Junko = strlen(str);
  if (Junko < 3) return 0;
  if (strcmp(str + Junko - 4, "lios") == 0) return 1;
  if (strcmp(str + Junko - 5, "liala") == 0) return -1;
  if (strcmp(str + Junko - 3, "etr") == 0) return 2;
  if (strcmp(str + Junko - 4, "etra") == 0) return -2;
  if (strcmp(str + Junko - 6, "initis") == 0) return 3;
  if (strcmp(str + Junko - 6, "inites") == 0) return -3;
  return 0;
}
int main() {
  while (gets(Zun)) {
    int tp = 0, t;
    int Junko = strlen(Zun), dcb = 0;
    int jiege = 0, awei = 1;
    for (register int i = 0; i <= Junko; ++i) {
      if (Zun[i] != ' ' && Zun[i] != '\0')
        str[jiege++] = Zun[i];
      else {
        str[jiege] = '\0', t = Extend(), dcb++;
        if (t != 0)
          Touhou[tp++] = t;
        else {
          awei = 0;
          break;
        }
      }
    }
    if (dcb == 1 && awei == 1) {
      puts("YES");
      continue;
    }
    if (awei == 0) {
      puts("NO");
      continue;
    }
    dcb = 0;
    for (register int i = 0; i < tp; ++i) {
      if (abs(Touhou[i]) == 2) dcb++;
    }
    if (dcb != 1) {
      puts("NO");
      continue;
    }
    awei = 1;
    if (Touhou[0] < 0) {
      for (register int i = 1; i < tp; ++i) {
        if (Touhou[i] > 0) {
          awei = 0;
          break;
        }
      }
    } else {
      for (register int i = 1; i < tp; ++i) {
        if (Touhou[i] < 0) {
          awei = 0;
          break;
        }
      }
    }
    if (awei == 0) {
      puts("NO");
      continue;
    }
    awei = 1;
    for (register int i = 1; i < tp; ++i) {
      if (abs(Touhou[i]) < abs(Touhou[i - 1])) {
        awei = 0;
        break;
      }
    }
    if (awei)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
