#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int main() {
  char x[100000];
  gets(x);
  char *pch, *a[100000];
  int co = 0;
  pch = strtok(x, " ");
  while (pch != NULL) {
    a[co++] = strdup(pch);
    pch = strtok(NULL, " ");
  }
  int i;
  int m = 0, f = 0;
  int ad = 0, nu = 0, ve = 0;
  char a1[4], a2[5], a3[6], a4[7];
  int fl = 0, j, co1 = 0, st;
  int p1 = 0, p2 = 0, p3 = 0, p4 = 0, p5 = 0, p6 = 0;
  for (j = 0; j < co; j++) {
    p1 = 0;
    p2 = 0;
    p3 = 0;
    p4 = 0;
    p5 = 0;
    p6 = 0;
    co1 = 0;
    for (i = strlen(a[j]) - 3; i < strlen(a[j]); i++) {
      a1[co1++] = a[j][i];
    }
    a1[co1] = '\0';
    if (strcmp(a1, "etr") == 0) {
      p1 = 1;
      m = 1;
      nu++;
      if (nu == 1) st = ad;
    }
    co1 = 0;
    for (i = (strlen(a[j]) - 4); i < strlen(a[j]); i++) {
      a2[co1++] = a[j][i];
    }
    a2[co1] = '\0';
    co1 = 0;
    if (strcmp(a2, "lios") == 0) {
      p2 = 1;
      m = 1;
      ad++;
    } else if (strcmp(a2, "etra") == 0) {
      p3 = 1;
      f = 1;
      nu++;
      if (nu == 1) st = ad;
    }
    for (i = (strlen(a[j]) - 5); i < strlen(a[j]); i++) {
      a3[co1++] = a[j][i];
    }
    a3[co1] = '\0';
    co1 = 0;
    if (strcmp(a3, "liala") == 0) {
      p4 = 1;
      f = 1;
      ad++;
    }
    for (i = (strlen(a[j]) - 6); i < strlen(a[j]); i++) {
      a4[co1++] = a[j][i];
    }
    a4[co1] = '\0';
    co1 = 0;
    if (strcmp(a4, "inites") == 0) {
      p5 = 1;
      f = 1;
      ve++;
    } else if (strcmp(a4, "initis") == 0) {
      p6 = 1;
      m = 1;
      ve++;
    }
    if (co != 1 && nu == 0 && ve > 0) {
      fl = 1;
      break;
    }
    if (m == 1 && f == 1) {
      fl = 1;
      break;
    }
    if (p1 == 0 && p2 == 0 && p3 == 0 && p4 == 0 && p5 == 0 && p6 == 0) {
      fl = 1;
      break;
    }
  }
  if (co == 1) {
    if (fl == 0)
      printf("YES\n");
    else
      printf("NO\n");
  } else {
    if (fl == 1)
      printf("NO\n");
    else {
      if ((ad == st) && ad >= 0 && nu == 1 && ve >= 0)
        printf("YES\n");
      else
        printf("NO\n");
    }
  }
  return 0;
}
