#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
struct Word {
  string str;
  int type;
  int g;
};
string getLast(string s, int cnt) {
  string res = "";
  int st = (int)(s).size() - cnt;
  if (st < 0) return res;
  for (int i = 0; i < cnt; i++) res += s[st + i];
  return res;
}
int main() {
  vector<Word> v;
  string s;
  while (cin >> s) {
    Word cur;
    cur.str = s;
    if (getLast(s, 4) == "lios") {
      cur.g = 1;
      cur.type = 1;
    } else if (getLast(s, 5) == "liala") {
      cur.g = 0;
      cur.type = 1;
    } else if (getLast(s, 3) == "etr") {
      cur.g = 1;
      cur.type = 0;
    } else if (getLast(s, 4) == "etra") {
      cur.g = 0;
      cur.type = 0;
    } else if (getLast(s, 6) == "initis") {
      cur.g = 1;
      cur.type = 2;
    } else if (getLast(s, 6) == "inites") {
      cur.g = 0;
      cur.type = 2;
    } else {
      puts("NO");
      return 0;
    }
    v.push_back(cur);
  }
  if ((int)(v).size() == 1) {
    puts("YES");
    return 0;
  }
  bool same = true;
  for (int j = 0; j < (int)(v).size() - 1; j++)
    if (v[j].g != v[j + 1].g) same = false;
  if (!same) {
    puts("NO");
    return 0;
  }
  int i = 0;
  for (; i < (int)(v).size(); i++) {
    if (v[i].type != 1) break;
  }
  int cnt = 0;
  for (; i < (int)(v).size(); i++) {
    if (v[i].type != 0) break;
    cnt++;
  }
  if (cnt != 1) {
    puts("NO");
    return 0;
  }
  for (; i < (int)(v).size(); i++)
    if (v[i].type != 2) break;
  if (i == (int)(v).size())
    puts("YES");
  else
    puts("NO");
  return 0;
}
