#include <bits/stdc++.h>
using namespace std;
map<string, pair<bool, int>> Data;
string msg = "";
void setData() {
  Data["lios"] = {1, 1};
  Data["liala"] = {0, 1};
  Data["etr"] = {1, 2};
  Data["etra"] = {0, 2};
  Data["initis"] = {1, 3};
  Data["inites"] = {0, 3};
}
pair<bool, int> find_out(string s) {
  string end = "";
  for (int i = (int)s.size() - 1; i >= 0 && (int)s.size() - i <= 6; --i) {
    end = s[i] + end;
    if ((int)s.size() - i == 3) {
      if (Data.find(end) != Data.end()) return Data[end];
    } else if ((int)s.size() - i == 4) {
      if (Data.find(end) != Data.end()) return Data[end];
    } else if ((int)s.size() - i == 5) {
      if (Data.find(end) != Data.end()) return Data[end];
    } else if ((int)s.size() - i == 6) {
      if (Data.find(end) != Data.end()) return Data[end];
    }
  }
  return {0, -1};
}
bool analize_grammar(vector<int> &g) {
  int i;
  int line = 1;
  bool ord = true;
  int aln = 0;
  for (i = 0; i < (int)g.size() - 1; ++i) {
    ord = ord & (g[i] <= g[i + 1]);
    aln += (g[i] == 2);
  }
  aln += (g[(int)g.size() - 1] == 2);
  return (aln == 1) && ord;
}
bool analize_gender(int &e, int &nw) { return ((e) ? e == nw : true); }
bool test_Word() { return find_out(msg) != pair<bool, int>(0, -1); }
bool test_Statement() {
  int e_gender = 0;
  int n_words = 0;
  vector<int> grammar;
  string s = "";
  for (int i = 0; i < (int)msg.size(); ++i) {
    if (msg[i] == ' ') {
      ++n_words;
      pair<bool, int> temp = find_out(s);
      if (temp == pair<bool, int>(0, -1)) return false;
      s = "";
      grammar.push_back(temp.second);
      e_gender += temp.first;
    } else {
      s.push_back(msg[i]);
    }
  }
  ++n_words;
  if (n_words == 1) return test_Word();
  pair<bool, int> temp = find_out(s);
  if (temp == pair<bool, int>(0, -1)) return false;
  s = "";
  grammar.push_back(temp.second);
  e_gender += temp.first;
  return analize_grammar(grammar) && analize_gender(e_gender, n_words);
}
int main() {
  setData();
  getline(cin, msg);
  if (test_Statement()) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
