#include <bits/stdc++.h>
using namespace std;
pair<int, int> getword() {
  string s;
  if (!(cin >> s)) return make_pair(-1, -1);
  reverse(s.begin(), s.end());
  if (string(s.begin(), s.begin() + min((int)s.size(), 4)) == "soil")
    return make_pair(0, 0);
  if (string(s.begin(), s.begin() + min((int)s.size(), 5)) == "alail")
    return make_pair(0, 1);
  if (string(s.begin(), s.begin() + min((int)s.size(), 3)) == "rte")
    return make_pair(1, 0);
  if (string(s.begin(), s.begin() + min((int)s.size(), 4)) == "arte")
    return make_pair(1, 1);
  if (string(s.begin(), s.begin() + min((int)s.size(), 6)) == "sitini")
    return make_pair(2, 0);
  if (string(s.begin(), s.begin() + min((int)s.size(), 6)) == "setini")
    return make_pair(2, 1);
  cout << "NO" << endl;
  exit(0);
}
vector<pair<int, int> > v;
int main() {
  do {
    v.push_back(getword());
  } while (v.back() != make_pair(-1, -1));
  v.pop_back();
  if (v.size() == 1) {
    cout << "YES" << endl;
    return 0;
  }
  for (int i = 0; i < v.size(); i++)
    if (v[0].second != v[i].second) {
      cout << "NO" << endl;
      return 0;
    }
  for (; v.size() && v.back().first == 2;) v.pop_back();
  reverse(v.begin(), v.end());
  for (; v.size() && v.back().first == 0;) v.pop_back();
  if (v.size() == 1) {
    cout << "YES" << endl;
    return 0;
  }
  cout << "NO" << endl;
  return 0;
}
