#include <bits/stdc++.h>
using namespace std;
const long long M = 1e9 + 7;
const long long INF = 1e9;
inline long long pwr(long long base, long long n, long long m) {
  long long ans = 1;
  while (n > 0) {
    if (n % 2 == 1) ans = (ans * base) % m;
    base = (base * base) % m;
    n /= 2;
  }
  return ans;
}
string fetch(string str) {
  int ln = str.length();
  string t = "";
  ln--;
  while (ln >= 0) {
    t = str[ln] + t;
    if (t == "lios" || t == "etr" || t == "initis" || t == "liala" ||
        t == "etra" || t == "inites")
      return t;
    ln--;
  }
  return "";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s, str = "";
  getline(cin, s);
  vector<string> temp;
  int l = s.length();
  for (int i = 0; i < l; i++) {
    if (s[i] == ' ') {
      string tt = fetch(str);
      if (tt.length() == 0) {
        cout << "NO";
        return 0;
      }
      temp.push_back(tt);
      str = "";
    } else {
      str += s[i];
    }
  }
  string tt = fetch(str);
  if (tt.length() == 0) {
    cout << "NO";
    return 0;
  }
  temp.push_back(tt);
  bool m = false, f = false;
  for (auto i : temp) {
    if (i == "lios" || i == "etr" || i == "initis") m = true;
    if (i == "liala" || i == "etra" || i == "inites") f = true;
    if (m & f) {
      cout << "NO";
      return 0;
    }
  }
  bool adj = false, noun = false, verb = false;
  int nn = 0;
  if (temp.size() == 1) {
    cout << "YES";
    return 0;
  }
  for (auto i : temp) {
    if (i == "lios" || i == "liala") {
      if (noun || verb) {
        cout << "NO";
        return 0;
      }
      adj = true;
    } else if (i == "etr" || i == "etra") {
      nn++;
      if (verb) {
        cout << "NO";
        return 0;
      }
      noun = true;
    } else {
      if (!noun) {
        cout << "NO";
        return 0;
      }
      verb = true;
    }
  }
  if (nn != 1) {
    cout << "NO";
    return 0;
  }
  cout << "YES";
  return 0;
}
