#include <bits/stdc++.h>
using namespace std;
char s[100005], t[100005];
int ans[100005];
int f() {
  string x;
  int len = strlen(t);
  if (len >= 3) {
    x = "";
    for (int i = len - 3; i < len; i++) x.push_back(t[i]);
    if (x == "etr") return 3;
  }
  if (len >= 4) {
    x = "";
    for (int i = len - 4; i < len; i++) x.push_back(t[i]);
    if (x == "lios") return 1;
    if (x == "etra") return 4;
  }
  if (len >= 5) {
    x = "";
    for (int i = len - 5; i < len; i++) x.push_back(t[i]);
    if (x == "liala") return 2;
  }
  if (len >= 6) {
    x = "";
    for (int i = len - 6; i < len; i++) x.push_back(t[i]);
    if (x == "initis") return 5;
    if (x == "inites") return 6;
  }
  return 0;
}
int main() {
  gets(s);
  int i = 0, k = 0;
  while (i < strlen(s) && s[i]) {
    int j = 0;
    while (i < strlen(s) && s[i] != ' ') t[j++] = s[i++];
    i++;
    t[j] = 0;
    int x = f();
    if (k && (ans[k - 1] % 2) != (x % 2)) {
      puts("NO");
      return 0;
    }
    if (!x) {
      puts("NO");
      return 0;
    }
    ans[k++] = x;
  }
  if (k == 1) {
    puts("YES");
    return 0;
  }
  int flag = -1;
  for (int i = 0; i < k; i++) {
    ans[i] = (ans[i] + 1) / 2;
    if (ans[i] == 2) {
      flag = i;
    }
  }
  if (flag == -1) {
    puts("NO");
    return 0;
  }
  int ff = 1, fff = 1;
  for (int i = flag - 1; i >= 0; i--)
    if (ans[i] != 1) {
      ff = 0;
      break;
    }
  for (int i = flag + 1; i < k; i++)
    if (ans[i] != 3) {
      fff = 0;
      break;
    }
  if (ff && fff) {
    puts("YES");
    return 0;
  }
  puts("NO");
  return 0;
}
