#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
long long power(long long a, long long b) {
  long long ret = 1;
  while (b) {
    if (b & 1) ret *= a;
    a *= a;
    if (ret >= MOD) ret %= MOD;
    if (a >= MOD) a %= MOD;
    b >>= 1;
  }
  return ret;
}
long long inv(long long x) { return power(x, MOD - 2); }
const int N = 1e5 + 5;
string s, gen;
vector<string> v;
bool check(string sa, string val) {
  if ((int)sa.size() < (int)val.size()) return 0;
  for (int i = (int)sa.size() - 1, j = (int)val.size() - 1; j >= 0; i--, j--) {
    if (sa[i] != val[j]) return 0;
  }
  return 1;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  getline(cin, s);
  string tmp = "";
  for (int i = 0; i < (int)s.size(); i++) {
    if (s[i] == ' ') {
      v.push_back(tmp);
      tmp = "";
      continue;
    }
    tmp += s[i];
  }
  v.push_back(tmp);
  tmp = v[0];
  gen = "X";
  if (check(tmp, "lios") || check(tmp, "etr") || check(tmp, "initis"))
    gen = "M";
  if (check(tmp, "liala") || check(tmp, "etra") || check(tmp, "inites"))
    gen = "F";
  if (gen == "X") {
    cout << "NO";
    return 0;
  }
  int adj = 0, verb = 0, noun = 0;
  for (int i = 0; i < (int)v.size(); i++) {
    tmp = v[i];
    if (gen == "M") {
      if (!check(tmp, "lios") and !check(tmp, "etr") and
          !check(tmp, "initis")) {
        cout << "NO";
        return 0;
      }
    } else {
      if (!check(tmp, "liala") and !check(tmp, "etra") and
          !check(tmp, "inites")) {
        cout << "NO";
        return 0;
      }
    }
  }
  for (int i = 0; i < (int)v.size(); i++) {
    tmp = v[i];
    if (gen == "M") {
      if (check(tmp, "lios")) {
        ++adj;
        if (noun == 1 || verb > 0) {
          cout << "NO";
          return 0;
        }
      } else if (check(tmp, "etr")) {
        ++noun;
        if (verb > 0 || noun > 1) {
          cout << "NO";
          return 0;
        }
      } else if (check(tmp, "initis")) {
        ++verb;
        if (i == 0) {
          continue;
        }
        if (noun == 0) {
          cout << "NO";
          return 0;
        }
      }
    } else {
      if (check(tmp, "liala")) {
        ++adj;
        if (noun == 1 || verb > 0) {
          cout << "NO";
          return 0;
        }
      } else if (check(tmp, "etra")) {
        ++noun;
        if (verb > 0 || noun > 1) {
          cout << "NO";
          return 0;
        }
      } else if (check(tmp, "inites")) {
        ++verb;
        if (i == 0) {
          continue;
        }
        if (noun == 0) {
          cout << "NO";
          return 0;
        }
      }
    }
  }
  if (noun > 1 or (adj > 1 and noun == 0)) {
    cout << "NO";
    return 0;
  }
  cout << "YES";
}
