#include <bits/stdc++.h>
using namespace std;
int mx[4] = {-1, 0, 1, 0};
int my[4] = {0, 1, 0, -1};
inline void OPEN(string s) {
  freopen((s + ".in").c_str(), "r", stdin);
  freopen((s + ".out").c_str(), "w", stdout);
}
int status;
bool gender;
char word[100001], line[100001];
void cekword(const string& word, bool& gender, int& type) {
  if (word.find("lios", (int)(word).size() - 4) != string::npos) {
    gender = false;
    type = 0;
  } else if (word.find("liala", (int)(word).size() - 5) != string::npos) {
    gender = true;
    type = 0;
  } else if (word.find("etr", (int)(word).size() - 3) != string::npos) {
    gender = false;
    type = 1;
  } else if (word.find("etra", (int)(word).size() - 4) != string::npos) {
    gender = true;
    type = 1;
  } else if (word.find("initis", (int)(word).size() - 6) != string::npos) {
    gender = false;
    type = 2;
  } else if (word.find("inites", (int)(word).size() - 6) != string::npos) {
    gender = true;
    type = 2;
  } else {
    type = -1;
  }
}
int main() {
  scanf("%[^\n]", line);
  int pos = 0;
  status = 0;
  int n = 0;
  int type;
  bool gender, inv, allgender, hasnoun = false;
  string kata;
  int len = strlen(line);
  inv = false;
  while (!inv && (pos < len)) {
    n++;
    sscanf(line + pos, "%s", word);
    kata = word;
    pos += kata.size() + 1;
    cekword(kata, gender, type);
    if (type == -1) {
      inv = true;
      break;
    }
    if (n != 1 && gender != allgender) {
      inv = true;
      break;
    } else {
      allgender = gender;
    }
    if (type == 1) {
      if (hasnoun) {
        inv = true;
        break;
      }
      hasnoun = true;
    }
    if (status == type) {
      continue;
    }
    if (n == 1 || status <= type) {
      status = type;
    } else {
      inv = true;
      break;
    }
  }
  if (inv || (n > 1 && !hasnoun) || (len == 0)) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
  }
  return 0;
}
