#include <bits/stdc++.h>
typedef enum {
  SEX_UNDEF,
  SEX_MALE,
  SEX_FEMALE,
} Sex;
bool isEnd(const std::string& s, const std::string& end) {
  if (s.length() < end.length()) {
    return false;
  } else {
    return s.substr(s.length() - end.length(), end.length()) == end;
  }
}
bool sexIs(Sex sex) {
  static Sex _sex = SEX_UNDEF;
  if (_sex == SEX_UNDEF) {
    _sex = sex;
  }
  return _sex == sex;
}
bool isAdverb(const std::string& s) {
  if (isEnd(s, "lios")) {
    return sexIs(SEX_MALE);
  }
  if (isEnd(s, "liala")) {
    return sexIs(SEX_FEMALE);
  }
  return false;
}
bool isNoun(const std::string& s) {
  if (isEnd(s, "etr")) {
    return sexIs(SEX_MALE);
  }
  if (isEnd(s, "etra")) {
    return sexIs(SEX_FEMALE);
  }
  return false;
}
bool isVerb(const std::string& s) {
  if (isEnd(s, "initis")) {
    return sexIs(SEX_MALE);
  }
  if (isEnd(s, "inites")) {
    return sexIs(SEX_FEMALE);
  }
  return false;
}
int main(int argc, const char* argv[]) {
  std::string line;
  std::getline(std::cin, line);
  std::stringstream lineStream(line);
  std::string word;
  lineStream >> word;
  if (isAdverb(word)) {
    int adverbs = 0;
    bool isEnd = false;
    while (isAdverb(word)) {
      adverbs++;
      if (lineStream >> word) {
        continue;
      } else {
        isEnd = true;
        break;
      }
    }
    if (isEnd) {
      if (adverbs == 1) {
        std::cout << "YES";
        return 0;
      } else {
        std::cout << "NO";
        return 0;
      }
    }
    if (!isNoun(word)) {
      std::cout << "NO";
      return 0;
    }
    while (lineStream >> word) {
      if (!isVerb(word)) {
        std::cout << "NO";
        return 0;
      }
    }
    std::cout << "YES";
    return 0;
  } else if (isNoun(word)) {
    while (lineStream >> word) {
      if (!isVerb(word)) {
        std::cout << "NO";
        return 0;
      }
    }
    std::cout << "YES";
    return 0;
  } else if (isVerb(word)) {
    if (lineStream >> word) {
      std::cout << "NO";
      return 0;
    }
    std::cout << "YES";
    return 0;
  } else {
    std::cout << "NO";
    return 0;
  }
  return 0;
}
