#include <bits/stdc++.h>
using namespace std;
int main() {
  string x;
  getline(cin, x);
  stringstream ss;
  ss << x;
  bool can = true;
  vector<string> vec;
  bool fr = true;
  bool cc;
  bool cn1 = true;
  for (int i = 0; i < x.size(); i++) {
    if (!isalpha(x[i]) && !isspace(x[i])) {
      cn1 = false;
      break;
    }
  }
  if (cn1) {
    while (!ss.eof()) {
      string s;
      ss >> s;
      if (s.size() >= 4 && s.substr(s.size() - 4, s.size()) == "lios") {
        if (fr)
          cc = 1;
        else if (cc != 1) {
          can = false;
          break;
        }
        vec.push_back("a");
      } else if (s.size() >= 5 && s.substr(s.size() - 5, s.size()) == "liala") {
        if (fr)
          cc = 0;
        else if (cc != 0) {
          can = false;
          break;
        }
        vec.push_back("a");
      } else if (s.size() >= 3 && s.substr(s.size() - 3, s.size()) == "etr") {
        if (fr)
          cc = 1;
        else if (cc != 1) {
          can = false;
          break;
        }
        vec.push_back("n");
      } else if (s.size() >= 4 && s.substr(s.size() - 4, s.size()) == "etra") {
        if (fr)
          cc = 0;
        else if (cc != 0) {
          can = false;
          break;
        }
        vec.push_back("n");
      } else if (s.size() >= 6 &&
                 s.substr(s.size() - 6, s.size()) == "initis") {
        if (fr)
          cc = 1;
        else if (cc != 1) {
          can = false;
          break;
        }
        vec.push_back("v");
      } else if (s.size() >= 6 &&
                 s.substr(s.size() - 6, s.size()) == "inites") {
        if (fr)
          cc = 0;
        else if (cc != 0) {
          can = false;
          break;
        }
        vec.push_back("v");
      } else {
        can = false;
        break;
      }
      fr = false;
    }
  } else
    can = false;
  if (can) {
    int i = 0;
    while (i < vec.size() && vec[i] == "a") {
      i++;
    }
    bool cn = true;
    if (cn) {
      cn = false;
      if (i < vec.size() && vec[i] == "n") {
        cn = true;
        i++;
      }
    }
    if (i != vec.size()) {
      if (cn) {
        cn = false;
        while (i < vec.size() && vec[i] == "v") {
          cn = true;
          i++;
        }
      }
    }
    if ((int)vec.size() == 1 || (cn && i == (int)vec.size())) {
      cout << "YES" << endl;
    } else
      cout << "NO" << endl;
  } else
    cout << "NO" << endl;
}
