#include <bits/stdc++.h>
using namespace std;
enum Gender {
  UNKNOWN = 0,
  MALE = 1,
  FEMALE = 2,
};
enum WordType {
  INV = 0,
  ADJ = 1,
  NOUN = 2,
  VERB = 3,
};
enum State {
  ADJ_STATE = 0,
  NOUN_STATE = 1,
  VERB_STATE = 2,
};
bool compare_ending(const string &s1, const string &s2) {
  if (s1.size() < s2.size()) return false;
  return s1.compare(s1.size() - s2.size(), s2.size(), s2) == 0;
}
pair<WordType, Gender> parse_word(const string &s) {
  if (compare_ending(s, "lios")) {
    return make_pair(ADJ, MALE);
  }
  if (compare_ending(s, "liala")) {
    return make_pair(ADJ, FEMALE);
  }
  if (compare_ending(s, "etr")) {
    return make_pair(NOUN, MALE);
  }
  if (compare_ending(s, "etra")) {
    return make_pair(NOUN, FEMALE);
  }
  if (compare_ending(s, "initis")) {
    return make_pair(VERB, MALE);
  }
  if (compare_ending(s, "inites")) {
    return make_pair(VERB, FEMALE);
  }
  return make_pair(INV, UNKNOWN);
}
Gender gender = UNKNOWN;
bool parse(const vector<string> &s) {
  State state = ADJ_STATE;
  int index = 0;
  while (index < s.size()) {
    auto next = parse_word(s[index]);
    if (gender != UNKNOWN && next.second != gender) {
      return false;
    }
    gender = next.second;
    ++index;
    switch (state) {
      case ADJ_STATE:
        if (next.first == ADJ) {
          continue;
        } else if (next.first == NOUN) {
          state = NOUN_STATE;
          continue;
        } else {
          return false;
        }
      case NOUN_STATE:
        if (next.first == VERB) {
          state = VERB_STATE;
          continue;
        } else {
          return false;
        }
      case VERB_STATE:
        if (next.first == VERB) {
          continue;
        } else {
          return false;
        }
    }
  }
  if (state == VERB_STATE || state == NOUN_STATE) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  vector<string> vs;
  string s;
  while (cin >> s) {
    vs.push_back(s);
  }
  if (vs.size() == 1) {
    auto result = parse_word(vs[0]);
    if (result.first != INV) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
    return 0;
  }
  if (parse(vs)) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
