#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> Pii;
const string gobi[][3] = {{"lios", "etr", "initis"},
                          {"liala", "etra", "inites"}};
bool isSuffix(const string &s, const string &t) {
  int m = s.length(), n = t.length();
  if (m < n) return false;
  return (s.substr(m - n) == t);
}
Pii type(const string &s) {
  for (int i = 0; i < 2; ++i) {
    for (int j = 0; j < 3; ++j) {
      if (isSuffix(s, gobi[i][j])) return Pii(i, 1 << j);
    }
  }
  return Pii(-1, -1);
}
int main() {
  string str = "";
  getline(cin, str);
  stringstream ss(str);
  vector<Pii> T;
  string s;
  while (ss >> s) {
    T.push_back(type(s));
  }
  bool mistake = false;
  if (T.size() == 1) {
    if (T[0].first == -1) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
    }
    return 0;
  }
  for (int i = 0; i < T.size(); ++i) {
    if (T[i].first == -1 || (i > 0 && T[i - 1].first != T[i].first)) {
      cout << "NO" << endl;
      return 0;
    }
  }
  int record = 0;
  int status = 1;
  for (int i = 0; i < T.size(); ++i) {
    if (T[i].second == -1) {
      mistake = true;
      break;
    } else if (T[i].second == 1) {
      if (status != 1) {
        mistake = true;
        break;
      }
      status = 1;
      record |= status;
    } else if (T[i].second == 2) {
      if (status != 1) {
        mistake = true;
        break;
      }
      status = 2;
      record |= status;
    } else if (T[i].second == 4) {
      if (status != 2 && status != 4) {
        mistake = true;
        break;
      }
      status = 4;
      record |= status;
    }
  }
  if (!mistake && (record & 2)) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
