#include <bits/stdc++.h>
using namespace std;
const int OO = 0x3f3f3f3f, N = 1e2 + 5, mod = 1e9 + 7;
const double pi = acos(-1), EPS = 1e-8;
string str, tmp;
vector<string> v;
bool _man, _noun;
bool adj(string s, bool man) {
  if (man) {
    if (s.size() < 4) return 0;
    string ret = "";
    for (int i = s.size() - 4; i < s.size(); ++i) ret += s[i];
    return ret == "lios";
  } else {
    if (s.size() < 5) return 0;
    string ret = "";
    for (int i = s.size() - 5; i < s.size(); ++i) ret += s[i];
    return ret == "liala";
  }
}
bool noun(string s, bool man) {
  if (man) {
    if (s.size() < 3) return 0;
    string ret = "";
    for (int i = s.size() - 3; i < s.size(); ++i) ret += s[i];
    return ret == "etr";
  } else {
    if (s.size() < 4) return 0;
    string ret = "";
    for (int i = s.size() - 4; i < s.size(); ++i) ret += s[i];
    return ret == "etra";
  }
}
bool verb(string s, bool man) {
  if (s.size() < 6) return 0;
  string ret = "";
  for (int i = s.size() - 6; i < s.size(); ++i) ret += s[i];
  if (man)
    return ret == "initis";
  else
    return ret == "inites";
}
int main() {
  getline(cin, str);
  stringstream mycin;
  mycin << str;
  while (mycin >> tmp) v.push_back(tmp);
  if (v.size() == 1) {
    if (adj(str, 1) || adj(str, 0) || noun(str, 1) || noun(str, 0) ||
        verb(str, 1) || verb(str, 0))
      cout << "YES";
    else
      cout << "NO";
    return 0;
  }
  _man = adj(v[0], 1) || noun(v[0], 1) || verb(v[0], 1);
  int i = 0;
  while (i < v.size()) {
    if (adj(v[i], _man) && _noun == 0)
      ++i;
    else if (noun(v[i], _man) && _noun == 0)
      i += _noun = 1;
    else if (verb(v[i], _man) && _noun)
      ++i;
    else
      break;
  }
  if (i == v.size() && _noun)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
