#include <bits/stdc++.h>
using namespace std;
int get_gender(char a[]) {
  int len = strlen(a);
  if (len >= 3 && strcmp(a + len - 3, "etr") == 0) return 2;
  if (len >= 4 && strcmp(a + len - 4, "lios") == 0) return 1;
  if (len >= 6 && strcmp(a + len - 6, "initis") == 0) return 3;
  if (len >= 5 && strcmp(a + len - 5, "liala") == 0) return 4;
  if (len >= 4 && strcmp(a + len - 4, "etra") == 0) return 5;
  if (len >= 6 && strcmp(a + len - 6, "inites") == 0) return 6;
  return 0;
}
char q[100001];
int main() {
  int x;
  int y = -1;
  int ans = 0;
  int sign = 0;
  scanf("%s", q);
  x = get_gender(q);
  if (x == 0) {
    puts("NO");
    return 0;
  }
  while (scanf("%s", q) == 1) {
    if (!sign) {
      if (x == 3 || x == 6) {
        puts("NO");
        return 0;
      }
    }
    sign = 1;
    y = get_gender(q);
    if (y == 0) {
      puts("NO");
      return 0;
    }
    if ((y - 1) / 3 != (x - 1) / 3) {
      puts("NO");
      return 0;
    }
    if (x == y && (x - 1) % 3 == 1) {
      puts("NO");
      return 0;
    }
    if (x != y && y - x != 1) {
      puts("NO");
      return 0;
    }
    x = y;
  }
  if (!sign) {
    puts("YES");
    return 0;
  }
  if ((x - 1) % 3 < 1) {
    puts("NO");
    return 0;
  }
  puts("YES");
  return 0;
}
