#include <bits/stdc++.h>
using namespace std;
string adj[] = {"lios", "liala"};
string noun[] = {"etr", "etra"};
string verb[] = {"initis", "inites"};
bool suffix(const string &a, const string &sufijo) {
  int idx = a.rfind(sufijo);
  if (idx < 0) return false;
  return idx + sufijo.size() == a.size();
}
vector<string> data;
bool solve(bool flag) {
  int idx = 0;
  int n = data.size();
  while (idx < n && suffix(data[idx], adj[flag])) idx++;
  if (idx < n && suffix(data[idx], noun[flag]))
    idx++;
  else if (n > 1)
    return false;
  while (idx < n && suffix(data[idx], verb[flag])) idx++;
  return idx == n;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string cad;
  getline(cin, cad);
  stringstream ss(cad);
  while (ss >> cad) data.push_back(cad);
  cout << (solve(true) || solve(false) ? "YES" : "NO") << '\n';
  return 0;
}
