#include <bits/stdc++.h>
using namespace std;
int ri() {
  int r;
  cin >> r;
  return r;
}
unsigned int rui() {
  unsigned int r;
  cin >> r;
  return r;
}
long long rl() {
  long long r;
  cin >> r;
  return r;
}
unsigned long long rul() {
  unsigned long long r;
  cin >> r;
  return r;
}
double rd() {
  double r;
  cin >> r;
  return r;
}
string rss() {
  string r;
  cin >> r;
  return r;
}
string rs() {
  string r;
  getline(cin, r);
  return r;
}
vector<string> rvs(int n) {
  assert(n);
  vector<string> r;
  for (int i = 0; i < n; ++i) {
    string s = rs();
    while (s.empty()) s = rs();
    r.push_back(s);
  }
  return r;
}
vector<int> rvi(int n) {
  assert(n);
  vector<int> r;
  for (int i = 0; i < n; ++i) r.push_back(ri());
  return r;
}
vector<unsigned int> rvui(int n) {
  assert(n);
  vector<unsigned int> r;
  for (int i = 0; i < n; ++i) r.push_back(rui());
  return r;
}
vector<long long> rvl(int n) {
  assert(n);
  vector<long long> r;
  for (int i = 0; i < n; ++i) r.push_back(rl());
  return r;
}
vector<unsigned long long> rvul(int n) {
  assert(n);
  vector<unsigned long long> r;
  for (int i = 0; i < n; ++i) r.push_back(rul());
  return r;
}
vector<double> rvd(int n) {
  assert(n);
  vector<double> r;
  for (int i = 0; i < n; ++i) r.push_back(rd());
  return r;
}
bool ends(const string& s, const string& end) {
  if (s.size() < end.size()) return false;
  return s.compare(s.size() - end.size(), end.size(), end) == 0;
}
bool noun(const string& s) { return ends(s, "etr") || ends(s, "etra"); }
bool adj(const string& s) { return ends(s, "lios") || ends(s, "liala"); }
bool verb(const string& s) { return ends(s, "initis") || ends(s, "inites"); }
bool ok(const string& s) { return noun(s) || adj(s) || verb(s); }
bool fem(const string& s) {
  return ends(s, "liala") || ends(s, "etra") || ends(s, "inites");
}
int main(int argc, const char* argv[]) {
  auto s = rs();
  if (s.find(" ") == s.npos) {
    cout << (ok(s) ? "YES" : "NO") << endl;
    return 0;
  }
  bool fm = false;
  int st = -1;
  while (!s.empty()) {
    auto p = s.find(" ");
    string cur;
    if (p == s.npos) {
      cur = s;
      s.clear();
    } else {
      cur = s.substr(0, p);
      s.erase(0, p + 1);
    }
    if (!ok(cur)) {
      cout << "NO" << endl;
      return 0;
    }
    if (st == -1) {
      fm = fem(cur);
      st = 0;
    }
    if (fm != fem(cur)) {
      cout << "NO" << endl;
      return 0;
    }
    if (st == 0) {
      if (adj(cur)) continue;
      if (noun(cur)) {
        st = 1;
        continue;
      } else {
        cout << "NO" << endl;
        return 0;
      }
    } else if (st == 1) {
      if (verb(cur)) {
        st = 2;
        continue;
      } else {
        cout << "NO" << endl;
        return 0;
      }
    } else if (st == 2) {
      if (verb(cur)) continue;
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << (st == 1 || st == 2 ? "YES" : "NO") << endl;
  return 0;
}
