#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
char i[100008];
int w[6], g[2];
int get_stat() {
  int x = strlen(i), sz = 0;
  string cur = "";
  while (x--) {
    cur += i[x];
    ++sz;
    switch (sz) {
      case 3: {
        if (cur == (string) "rte") {
          ++g[0];
          return 1;
        }
        break;
      }
      case 4: {
        if (cur == (string) "soil") {
          ++g[0];
          return 0;
        }
        if (cur == (string) "arte") {
          ++g[1];
          return 1;
        }
        break;
      }
      case 5: {
        if (cur == (string) "alail") {
          ++g[1];
          return 0;
        }
        break;
      }
      case 6: {
        if (cur == (string) "sitini") {
          ++g[0];
          return 2;
        }
        if (cur == (string) "setini") {
          ++g[1];
          return 2;
        }
        return 3;
      }
    }
  }
  return 3;
}
int main() {
  int cur, jml = 0;
  memset((w), 0, sizeof(w));
  memset((g), 0, sizeof(g));
  scanf("%s", i);
  while (!feof(stdin)) {
    cur = get_stat();
    if (w[cur + 1] == 0)
      ++w[cur];
    else {
      ++w[3];
      break;
    }
    ++jml;
    scanf("%s", i);
  }
  if (((g[0] == 0) || (g[1] == 0)) && (w[3] == 0) &&
      ((w[1] == 1) || (jml == 1)))
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
