#include <bits/stdc++.h>
using namespace std;
vector<string> word;
int isok(string s) {
  string m = "";
  for (int i = s.length() - 1; i >= max(0, (int)s.length() - 7); i--) {
    m += s[i];
    if (m == "soil") return 0;
    if (m == "alail") return 1;
    if (m == "rte") return 2;
    if (m == "arte") return 3;
    if (m == "sitini") return 4;
    if (m == "setini") return 5;
  }
  return -1;
}
void doit() {
  vector<int> v;
  for (int i = 0; i < word.size(); i++) {
    int r = isok(word[i]);
    if (r == -1) {
      puts("NO");
      return;
    }
    v.push_back(r);
  }
  if (v.size() == 1) {
    puts("YES");
    return;
  }
  int cont = 0;
  for (int i = 0; i < v.size(); i++)
    if (v[i] == 2 || v[i] == 3) cont++;
  if (cont != 1) {
    puts("NO");
    return;
  }
  int a = v[0] % 2;
  for (int i = 0; i < v.size(); i++)
    if (v[i] % 2 != a) {
      puts("NO");
      return;
    }
  for (int i = 1; i < v.size(); i++) {
    if (v[i] < v[i - 1]) {
      puts("NO");
      return;
    }
  }
  puts("YES");
}
int main() {
  string s;
  getline(cin, s);
  stringstream in(s);
  string x;
  while (in >> x) {
    word.push_back(x);
  }
  doit();
}
