#include <bits/stdc++.h>
using namespace std;
string s;
long long n;
void gagal() {
  cout << "NO\n";
  exit(0);
}
long long cek(string a, string b) {
  long long lena = a.length();
  long long lenb = b.length();
  if (lena < lenb) return 0;
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  for (long long i = 0; i < lenb; i++)
    if (a[i] != b[i]) {
      return 0;
    }
  return 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long las = 0;
  long long noun = 0;
  long long gender = 0;
  while (cin >> s) {
    n++;
    long long jenis = 0;
    if (cek(s, "lios")) jenis = 1;
    if (cek(s, "liala")) jenis = 1, gender++;
    if (cek(s, "etr")) jenis = 2;
    if (cek(s, "etra")) jenis = 2, gender++;
    if (cek(s, "initis")) jenis = 3;
    if (cek(s, "inites")) jenis = 3, gender++;
    if (jenis == 0) gagal();
    if (jenis < las) gagal();
    las = jenis;
    if (jenis == 2) noun++;
  }
  if ((noun != 1) && (n != 1)) gagal();
  if (gender % n) gagal();
  cout << "YES\n";
}
