#include <bits/stdc++.h>
static const long long LLMAX = 0x7fffffffffffffffLL;
static const int IMAX = 0x7fffffff;
using namespace std;
bool endWith(const string& str, const string& suf) {
  if (str.length() < suf.length()) return false;
  string sub = str.substr(str.length() - suf.length());
  return sub == suf;
}
char type(const string& str) {
  if (endWith(str, "lios")) {
    return 'A';
  } else if (endWith(str, "liala")) {
    return 'B';
  } else if (endWith(str, "etr")) {
    return 'C';
  } else if (endWith(str, "etra")) {
    return 'D';
  } else if (endWith(str, "initis")) {
    return 'E';
  } else if (endWith(str, "inites")) {
    return 'F';
  } else {
    return 'X';
  }
}
int main() {
  string line;
  while (getline(cin, line)) {
    if (string::npos == line.find_first_of(' ')) {
      if (type(line) != 'X') {
        printf("YES\n");
      } else {
        printf("NO\n");
      }
      continue;
    }
    istringstream iss(line);
    bool valid = true;
    bool gender;
    bool fst = true;
    bool adj = false;
    bool noun = false;
    bool verb = false;
    while (iss >> line) {
      char ch = type(line);
      if (ch == 'X') {
        valid = false;
        break;
      }
      if (fst) {
        gender = (ch == 'A' || ch == 'C' || ch == 'E') ? true : false;
        fst = false;
      } else {
        if (gender != ((ch == 'A' || ch == 'C' || ch == 'E') ? true : false)) {
          valid = false;
          break;
        }
      }
      if (noun == true) {
        if (ch == 'A' || ch == 'B' || ch == 'C' || ch == 'D') {
          valid = false;
          break;
        }
      }
      if (noun == false) {
        if (ch == 'E' || ch == 'F') {
          valid = false;
          break;
        }
      }
      if (verb == true) {
        if (ch == 'A' || ch == 'B' || ch == 'C' || ch == 'D') {
          valid = false;
          break;
        }
      }
      if (ch == 'A' || ch == 'B') {
        adj = true;
      } else if (ch == 'C' || ch == 'D') {
        noun = true;
      } else if (ch == 'E' || ch == 'F') {
        verb = true;
      }
    }
    if (noun == false) {
      valid = false;
    }
    if (valid) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
  return 0;
}
