#include <bits/stdc++.h>
using namespace std;
inline long long in() {
  int32_t x;
  scanf("%d", &x);
  return x;
}
inline long long lin() {
  long long x;
  scanf("%lld", &x);
  return x;
}
const long long maxn = 1e5 + 10;
const long long inf = 1e18;
inline long long tp(string &s) {
  long long sz = s.size();
  if (sz >= 4 && s.substr(sz - 4, 4) == "lios") return 0;
  if (sz >= 3 && s.substr(sz - 3, 3) == "etr") return 0;
  if (sz >= 6 && s.substr(sz - 6, 6) == "initis") return 0;
  return 1;
}
inline long long tp_(string &s) {
  long long sz = s.size();
  if ((sz >= 4 && s.substr(sz - 4, 4) == "lios") ||
      (sz >= 5 && s.substr(sz - 5, 5) == "liala"))
    return 0;
  if ((sz >= 3 && s.substr(sz - 3, 3) == "etr") ||
      (sz >= 4 && s.substr(sz - 4, 4) == "etra"))
    return 1;
  if ((sz >= 6 && s.substr(sz - 6, 6) == "initis") ||
      (sz >= 6 && s.substr(sz - 6) == "inites"))
    return 2;
  return -1;
}
int32_t main() {
  string s;
  getline(cin, s);
  vector<string> words;
  for (long long i = 0; i < s.size(); i++) {
    if (i == 0 || (s[i - 1] == ' ')) {
      long long j = i;
      while (j + 1 < s.size() && s[j + 1] != ' ') j++;
      words.push_back(s.substr(i, j - i + 1));
      i = j + 1;
    }
  }
  for (long long i = 0; i < words.size(); i++)
    if (tp_(words[i]) == -1) return cout << "NO\n", 0;
  if (words.size() == 1) return cout << "YES\n", 0;
  long long pre = 0;
  bool fl = true;
  bool noun = false;
  for (long long i = 0; i < words.size(); i++) {
    if (tp_(words[i]) == 0) {
      if (pre == 0) continue;
      fl = false;
    } else if (tp_(words[i]) == 1) {
      if (pre <= 1) {
        noun = true;
        if (pre == 1) fl = false;
        pre = 1;
      } else
        fl = false;
    } else {
      if (pre <= 2)
        pre = 2;
      else
        fl = false;
    }
  }
  fl &= noun;
  for (long long i = 0; i + 1 < words.size(); i++)
    fl &= tp(words[i]) == tp(words[i + 1]);
  if (fl)
    cout << "YES\n";
  else
    cout << "NO\n";
}
