#include <bits/stdc++.h>
using namespace std;
vector<string> arr;
bool end(string s1, string s2) {
  string aux = "";
  for (int i = s1.size() - 1; i >= 0; i--) {
    aux = s1[i] + aux;
    if (aux.size() == s2.size()) break;
  }
  if (aux == s2) return true;
  return false;
}
int findA(string ss) {
  if (end(ss, "lios")) return 1;
  if (end(ss, "liala")) return 0;
  return -1;
}
int findN(string ss) {
  if (end(ss, "etr")) return 1;
  if (end(ss, "etra")) return 0;
  return -1;
}
int findV(string ss) {
  if (end(ss, "initis")) return 1;
  if (end(ss, "inites")) return 0;
  return -1;
}
int main() {
  int n = 0;
  string ss;
  while (cin >> ss) {
    arr.push_back(ss);
  }
  n = arr.size();
  int gender = -1;
  bool f1 = false, f2 = false, f3 = false;
  string adj, noun, verb;
  if (end(arr[0], "lios") || end(arr[0], "liala")) {
    gender = findA(arr[0]);
  }
  if (end(arr[0], "etr") || end(arr[0], "etra")) {
    gender = findN(arr[0]);
  }
  if (end(arr[0], "initis") || end(arr[0], "inites")) {
    gender = findV(arr[0]);
  }
  if (gender == 1) {
    adj = "lios";
    noun = "etr";
    verb = "initis";
  } else {
    adj = "liala";
    noun = "etra";
    verb = "inites";
  }
  if (gender == -1) {
    cout << "NO" << endl;
    return 0;
  }
  if (n == 1) {
    cout << "YES" << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    if (end(arr[i], adj)) {
      if (f2) {
        cout << "NO" << endl;
        return 0;
      }
      if (f3) {
        cout << "NO" << endl;
        return 0;
      }
      if (findA(arr[i]) != gender) {
        cout << "NO" << endl;
        return 0;
      }
      f1 = true;
      continue;
    }
    if (end(arr[i], noun)) {
      if (f2) {
        cout << "NO" << endl;
        return 0;
      }
      if (f3) {
        cout << "NO" << endl;
        return 0;
      }
      if (findN(arr[i]) != gender) {
        cout << "NO" << endl;
        return 0;
      }
      f2 = true;
      continue;
    }
    if (end(arr[i], verb)) {
      if (!f2) {
        cout << "NO" << endl;
        return 0;
      }
      if (findV(arr[i]) != gender) {
        cout << "NO" << endl;
        return 0;
      }
      f3 = true;
      continue;
    }
    cout << "NO" << endl;
    return 0;
  }
  if (!f2) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  return 0;
}
