#include <bits/stdc++.h>
using namespace std;
vector<string> a;
vector<int> b;
string e[3][2];
int cc(string s) {
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 2; j++) {
      if (s.size() >= e[i][j].size() &&
          s.substr(s.size() - e[i][j].size(), e[i][j].size()) == e[i][j]) {
        return i * 2 + j;
      }
    }
  }
  return -1;
}
int main() {
  string s;
  while (cin >> s) {
    a.push_back(s);
  }
  e[0][0] = "lios";
  e[0][1] = "liala";
  e[1][0] = "etr";
  e[1][1] = "etra";
  e[2][0] = "initis";
  e[2][1] = "inites";
  for (int i = 0; i < a.size(); i++) {
    b.push_back(cc(a[i]));
    if (b[i] == -1) {
      cout << "NO" << endl;
      return 0;
    }
  }
  for (int i = 0; i < b.size() - 1; i++) {
    if (b[i] % 2 != b[i + 1] % 2) {
      cout << "NO" << endl;
      return 0;
    }
  }
  int cnt = 0;
  for (int i = 0; i < b.size(); i++) {
    b[i] /= 2;
    if (b[i] == 1) {
      cnt++;
    }
    if (cnt > 1) {
      cout << "NO" << endl;
      return 0;
    }
  }
  if (cnt != 1) {
    if (cnt > 1) {
      cout << "NO" << endl;
      return 0;
    }
    if (cnt == 0 && a.size() > 1) {
      cout << "NO" << endl;
      return 0;
    }
  }
  for (int i = 0; i < b.size() - 1; i++) {
    if (b[i] > b[i + 1]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
