#include <bits/stdc++.h>
using namespace std;
enum { INF = 1000000000, MAX = 2147483640, MIN = -1 };
string mod[] = {"lios", "etr", "initis", "liala", "etra", "inites"};
vector<string> sen;
int gender(string s) {
  for (int i = 0; i <= 5; i++) {
    int len = s.size() - mod[i].size();
    if (len >= 0 && s.substr(len) == mod[i] && i >= 0 && i <= 2) return 1;
    if (len >= 0 && s.substr(len) == mod[i] && i >= 3 && i <= 5) return 0;
  }
  return 2;
}
int ismingci(string s) {
  int len1 = s.size() - mod[1].size(), len2 = s.size() - mod[4].size();
  len1 = max(len1, 0);
  len2 = max(len2, 0);
  if (s.substr(len1) == mod[1] || s.substr(len2) == mod[4]) return 1;
  return 0;
}
int isxingrongci(string s) {
  int len1 = s.size() - mod[0].size(), len2 = s.size() - mod[3].size();
  len1 = max(len1, 0);
  len2 = max(len2, 0);
  if (s.substr(len1) == mod[0] || s.substr(len2) == mod[3]) return 1;
  return 0;
}
int isdongci(string s) {
  int len1 = s.size() - mod[2].size(), len2 = s.size() - mod[5].size();
  len1 = max(len1, 0);
  len2 = max(len2, 0);
  if (s.substr(len1) == mod[2] || s.substr(len2) == mod[5]) return 1;
  return 0;
}
void isSen(int pos) {
  int gender1 = gender(sen[pos]);
  bool ok = true;
  for (int i = pos - 1, j = pos + 1; (i >= 0 || j < sen.size()); i--, j++) {
    if ((i >= 0 && ismingci(sen[i])) || (j < sen.size() && ismingci(sen[j]))) {
      ok = false;
      break;
    }
    if (i >= 0 && isxingrongci(sen[i]) && gender(sen[i]) == gender1)
      ;
    else if (i >= 0) {
      ok = false;
      break;
    }
    if (j < sen.size() && isdongci(sen[j]) && gender(sen[j]) == gender1)
      ;
    else if (j < sen.size()) {
      ok = false;
      break;
    }
  }
  if (ok)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
int main() {
  string tmp;
  int cnt = 0, pos = -1;
  getline(cin, tmp);
  istringstream iss(tmp);
  string n;
  while (iss >> n) {
    sen.push_back(n);
    if (ismingci(n)) {
      if (pos != -1) {
        cout << "NO" << endl;
        return 0;
      }
      pos = cnt;
    }
    cnt++;
  }
  if (sen.size() == 1 &&
      (isdongci(sen[0]) || ismingci(sen[0]) || isxingrongci(sen[0])))
    cout << "YES" << endl;
  else if (pos == -1)
    cout << "NO" << endl;
  else
    isSen(pos);
  return 0;
}
