#include <bits/stdc++.h>
using namespace std;
vector<string> vec;
int n;
vector<pair<string, int> > arr;
string a[] = {"lios", "etr", "initis", "liala", "etra", "inites"};
int g[] = {0, 0, 0, 1, 1, 1};
int gender() {
  set<int> st;
  for (auto i = 0; i < (long long)(n); i++) {
    string x = "";
    for (int j = 6; j >= 3; j--) {
      if (((int)((vec[i]).size())) >= j) {
        x = vec[i].substr(((int)((vec[i]).size())) - j, j);
        break;
      }
    }
    bool found = false;
    for (auto j = 0; j < (long long)(6); j++) {
      int idx = x.find(arr[j].first);
      if ((idx != string::npos) &&
          (idx + ((int)((arr[j].first).size())) == ((int)((x).size())))) {
        found = true;
        st.insert(arr[j].second);
        break;
      }
    }
    if (!found) return 2;
  }
  if (((int)((st).size())) == 2 || st.empty()) return 2;
  return *st.begin();
}
int main() {
  ios_base::sync_with_stdio(0);
  string x;
  while (cin >> x) vec.push_back(x);
  for (auto i = 0; i < (long long)(6); i++) arr.push_back({a[i], g[i]});
  sort(arr.rbegin(), arr.rend());
  n = ((int)((vec).size()));
  int hoba = gender();
  if (hoba == 2) return cout << "NO", 0;
  if (n == 1) return cout << "YES", 0;
  int idx = -1, cnt = 0;
  if (!hoba) {
    for (auto i = 0; i < (long long)(((int)((vec).size()))); i++) {
      string y = vec[i].substr(((int)((vec[i]).size())) - 3, 3);
      if (y == "etr") idx = i, cnt++;
    }
    if (cnt != 1) return cout << "NO", 0;
    for (auto i = 0; i < (long long)(idx); i++) {
      string y = vec[i];
      if (((int)((y).size())) < 4) return cout << "NO", 0;
      y = vec[i].substr(((int)((vec[i]).size())) - 4, 4);
      if (y != "lios") return cout << "NO", 0;
    }
    for (auto i = idx + 1; i < (long long)(n); i++) {
      string y = vec[i];
      if (((int)((y).size())) < 6) return cout << "NO", 0;
      y = vec[i].substr(((int)((vec[i]).size())) - 6, 6);
      if (y != "initis") return cout << "NO", 0;
    }
  } else {
    for (auto i = 0; i < (long long)(((int)((vec).size()))); i++) {
      if (((int)((vec[i]).size())) < 4) continue;
      string y = vec[i].substr(((int)((vec[i]).size())) - 4, 4);
      if (y == "etra") idx = i, cnt++;
    }
    if (cnt != 1) return cout << "NO", 0;
    for (auto i = 0; i < (long long)(idx); i++) {
      string y = vec[i];
      if (((int)((y).size())) < 5) return cout << "NO", 0;
      y = vec[i].substr(((int)((vec[i]).size())) - 5, 5);
      if (y != "liala") return cout << "NO", 0;
    }
    for (auto i = idx + 1; i < (long long)(n); i++) {
      string y = vec[i];
      if (((int)((y).size())) < 6) return cout << "NO", 0;
      y = vec[i].substr(((int)((vec[i]).size())) - 6, 6);
      if (y != "inites") return cout << "NO", 0;
    }
  }
  cout << "YES";
  return 0;
}
