#include <bits/stdc++.h>
using namespace std;
vector<string> words;
map<string, pair<int, bool> > type;
void check(string word, int &anv, bool &mf) {
  string tmp;
  for (int i = word.size() - 1, c = 0; i >= 0 and c < 6; i--, c++) {
    tmp += word[i];
    if (type.find(tmp) != type.end()) {
      anv = type[tmp].first;
      mf = type[tmp].second;
      return;
    }
  }
  anv = -1;
  mf = 0;
}
int main() {
  type["soil"] = {1, 0};
  type["alail"] = {1, 1};
  type["rte"] = {2, 0};
  type["arte"] = {2, 1};
  type["sitini"] = {3, 0};
  type["setini"] = {3, 1};
  string s;
  getline(cin, s);
  s += ' ';
  string tmp;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == ' ') {
      words.push_back(tmp);
      tmp = "";
    } else {
      tmp += s[i];
    }
  }
  int anv;
  bool mf;
  int state = 1, gender = -1;
  if (words.size() == 1) {
    check(words[0], anv, mf);
    if (anv == -1) {
      puts("NO");
      return 0;
    } else {
      puts("YES");
      return 0;
    }
  } else {
    for (int i = 0; i < words.size(); i++) {
      check(words[i], anv, mf);
      if (state == 1 and anv == 3) {
        puts("NO");
        return 0;
      }
      if (state == 2 and anv != 3) {
        puts("NO");
        return 0;
      }
      if (state == 3 and anv != 3) {
        puts("NO");
        return 0;
      }
      if (anv == -1) {
        puts("NO");
        return 0;
      }
      state = anv;
      if (gender == -1) {
        gender = mf;
        continue;
      }
      if (gender != mf) {
        puts("NO");
        return 0;
      }
    }
  }
  if (state == 1)
    puts("NO");
  else
    puts("YES");
  return 0;
}
