#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-13;
const int INF = 2000000000;
const long long MOD = 1e9 + 7;
const int N = 100005;
const int M = 600000;
const double pi = acos(-1.0);
string str, sub;
int type[100005], sex[100005], cnt;
bool add() {
  int l = sub.length();
  if (l >= 4 && sub.substr(l - 4) == "lios") {
    type[cnt] = 1;
    sex[cnt++] = 0;
    return true;
  }
  if (l >= 5 && sub.substr(l - 5) == "liala") {
    type[cnt] = 1;
    sex[cnt++] = 1;
    return true;
  }
  if (l >= 3 && sub.substr(l - 3) == "etr") {
    type[cnt] = 2;
    sex[cnt++] = 0;
    return true;
  }
  if (l >= 4 && sub.substr(l - 4) == "etra") {
    type[cnt] = 2;
    sex[cnt++] = 1;
    return true;
  }
  if (l >= 6 && sub.substr(l - 6) == "initis") {
    type[cnt] = 3;
    sex[cnt++] = 0;
    return true;
  }
  if (l >= 6 && sub.substr(l - 6) == "inites") {
    type[cnt] = 3;
    sex[cnt++] = 1;
    return true;
  }
  return false;
}
int main() {
  getline(cin, str);
  int s = 0;
  cnt = 0;
  bool F = true;
  for (int i = 0; i < str.length(); i++) {
    if (str[i] == ' ') {
      sub = str.substr(s, i - s);
      if (!add()) F = false;
      s = i + 1;
    }
  }
  sub = str.substr(s);
  if (!add()) F = false;
  for (int i = 1; i < cnt; i++)
    if (sex[i] != sex[i - 1]) {
      F = false;
      break;
    }
  int now = -1;
  if (cnt == 1) now = 0;
  for (int i = 0; i < cnt; i++) {
    if (type[i] == 2) {
      now = i;
      break;
    }
  }
  if (now == -1)
    F = false;
  else {
    for (int i = 0; i < now; i++)
      if (type[i] != 1) {
        F = false;
        break;
      }
    for (int i = now + 1; i < cnt; i++)
      if (type[i] != 3) {
        F = false;
        break;
      }
  }
  if (!F)
    printf("NO\n");
  else
    printf("YES\n");
  return 0;
}
