#include <bits/stdc++.h>
using namespace std;
bool debug = false;
char tmp[100005];
vector<string> split(string s, char c, bool keepSpliter = false) {
  string part = "";
  s += c;
  vector<string> v;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == c) {
      if (part != "") {
        v.push_back(part);
      }
      string temp = "";
      temp += c;
      if (keepSpliter) v.push_back(temp);
      part = "";
    } else {
      part += s[i];
    }
  }
  return v;
}
bool end_with(string a, string b) {
  if (b.size() > a.size()) return false;
  if (a.substr(a.size() - b.size()) == b) {
    return true;
  }
  return false;
}
int getPart(string s) {
  if (end_with(s, "lios") || end_with(s, "liala")) {
    return 0;
  }
  if (end_with(s, "etr") || end_with(s, "etra")) {
    return 1;
  }
  if (end_with(s, "initis") || end_with(s, "inites")) {
    return 2;
  }
  return -1;
}
bool valid(string s) { return getPart(s) != -1; }
bool getGender(string s) {
  if (end_with(s, "lios") || end_with(s, "etr") || end_with(s, "initis"))
    return true;
  return false;
}
int main(int argc, char* argv[]) {
  gets(tmp);
  vector<string> vs = split(tmp, ' ', false);
  bool mother = getGender(vs[0]);
  for (int i = 0; i < vs.size(); i++) {
    if (!valid(vs[i]) || getGender(vs[i]) != mother) {
      cout << "NO";
      return 0;
    }
  }
  if (vs.size() == 1) {
    cout << "YES";
    return 0;
  }
  int p = 0;
  while (getPart(vs[p]) == 0) {
    p++;
    if (p == vs.size()) {
      cout << "NO";
      return 0;
    }
  }
  if (getPart(vs[p]) != 1) {
    cout << "NO";
    return 0;
  }
  p++;
  while (p < vs.size() && getPart(vs[p]) == 2) {
    p++;
  }
  if (p != vs.size()) {
    cout << "NO";
  } else {
    cout << "YES";
  }
  return 0;
}
