#include <bits/stdc++.h>
using namespace std;
string mNoun = "rte", fNoun = "arte";
string mAdj = "soil", fAdj = "alail";
string mVerb = "sitini", fVerb = "setini";
vector<string> lang;
class Solution {
 public:
  bool valid(string s) {
    if ((s.substr(0, 3) == mNoun) || (s.substr(0, 4) == fNoun) ||
        (s.substr(0, 4) == mAdj) || (s.substr(0, 5) == fAdj) ||
        (s.substr(0, 6) == mVerb) || (s.substr(0, 6) == fVerb))
      return true;
    return false;
  }
  void solve(std::istream& in, std::ostream& out) {
    string s;
    int mid = -1;
    while (cin >> s) {
      reverse((s).begin(), (s).end());
      lang.push_back(s);
      if (s.substr(0, (int)mNoun.size()) == mNoun ||
          s.substr(0, (int)fNoun.size()) == fNoun) {
        mid = (int)lang.size() - 1;
      }
    }
    if ((int)lang.size() == 1) {
      if (valid(lang[0]))
        out << "YES" << '\n';
      else
        out << "NO" << '\n';
      return;
    }
    if (mid == -1) {
      out << "NO" << '\n';
      return;
    } else {
      string sLeft, sRight;
      if (lang[mid].substr(0, (int)mNoun.size()) == mNoun) {
        sLeft = mAdj;
        sRight = mVerb;
      } else {
        sLeft = fAdj;
        sRight = fVerb;
      }
      int pos = mid - 1;
      while (pos >= 0) {
        if (lang[pos].substr(0, (int)sLeft.size()) != sLeft) {
          out << "NO" << '\n';
          return;
        }
        pos--;
      }
      pos = mid + 1;
      while (pos < (int)lang.size()) {
        if (lang[pos].substr(0, (int)sRight.size()) != sRight) {
          out << "NO" << '\n';
          return;
        }
        pos++;
      }
      out << "YES" << '\n';
    }
    return;
  }
};
void solve(std::istream& in, std::ostream& out) {
  out << std::setprecision(12);
  Solution solution;
  solution.solve(in, out);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  istream& in = cin;
  ostream& out = cout;
  solve(in, out);
  return 0;
}
