#include <bits/stdc++.h>
using namespace std;
enum class Word { ADJECTIVE, NOUN, VERB };
bool ends_with(const string& s, const string& prefix) {
  if (prefix.size() > s.size()) {
    return false;
  }
  int start_index = s.size() - prefix.size();
  for (int i = 0; i < prefix.size(); ++i) {
    if (s[start_index + i] != prefix[i]) {
      return false;
    }
  }
  return true;
}
int main() {
  string in;
  vector<string> v;
  while (cin >> in) {
    v.push_back(in);
  }
  if (v.size() == 1) {
    const string& s = v[0];
    if (ends_with(s, "lios") || ends_with(s, "liala") || ends_with(s, "etr") ||
        ends_with(s, "etra") || ends_with(s, "initis") ||
        ends_with(s, "inites")) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
    return 0;
  }
  bool has_gender = false;
  bool is_male;
  Word expected_word = Word::ADJECTIVE;
  for (const string& s : v) {
    switch (expected_word) {
      case Word::ADJECTIVE:
        if (ends_with(s, "lios")) {
          if (has_gender) {
            if (!is_male) {
              cout << "NO" << endl;
              return 0;
            }
          } else {
            has_gender = true;
            is_male = true;
          }
          break;
        }
        if (ends_with(s, "liala")) {
          if (has_gender) {
            if (is_male) {
              cout << "NO" << endl;
              return 0;
            }
          } else {
            has_gender = true;
            is_male = false;
          }
          break;
        }
        expected_word = Word::NOUN;
      case Word::NOUN:
        if (ends_with(s, "etr")) {
          if (has_gender) {
            if (!is_male) {
              cout << "NO" << endl;
              return 0;
            }
          } else {
            has_gender = true;
            is_male = true;
          }
          expected_word = Word::VERB;
          break;
        }
        if (ends_with(s, "etra")) {
          if (has_gender) {
            if (is_male) {
              cout << "NO" << endl;
              return 0;
            }
          } else {
            has_gender = true;
            is_male = false;
          }
          expected_word = Word::VERB;
          break;
        }
        cout << "NO" << endl;
        return 0;
      case Word::VERB:
        if (ends_with(s, "initis")) {
          if (!is_male) {
            cout << "NO" << endl;
            return 0;
          }
          break;
        }
        if (ends_with(s, "inites")) {
          if (is_male) {
            cout << "NO" << endl;
            return 0;
          }
          break;
        }
        cout << "NO" << endl;
        return 0;
    }
  }
  if (expected_word == Word::VERB) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
