#include <bits/stdc++.h>
using namespace std;
int getint() {
  int a;
  scanf("%d", &a);
  return a;
}
double getdouble() {
  double a;
  scanf("%lf", &a);
  return a;
}
char sbuf[100005];
string getstring() {
  scanf("%s", sbuf);
  return sbuf;
}
long long getlong() {
  long long a;
  scanf("%lld", &a);
  return a;
}
template <class T>
void out(T a, T b) {
  bool first = true;
  for (T i = a; i != b; ++i) {
    if (!first) printf(" ");
    first = false;
    cout << *i;
  }
  printf("\n");
}
template <class T>
void outl(T a, T b) {
  for (T i = a; i != b; ++i) {
    cout << *i << "\n";
  }
}
int testPetr(string s) {
  if (s.size() > 3 && s.substr(s.size() - 4, 4) == "lios")
    return 11;
  else if (s.size() > 4 && s.substr(s.size() - 5, 5) == "liala")
    return 21;
  else if (s.size() > 2 && s.substr(s.size() - 3, 3) == "etr")
    return 12;
  else if (s.size() > 3 && s.substr(s.size() - 4, 4) == "etra")
    return 22;
  else if (s.size() > 5 && s.substr(s.size() - 6, 6) == "initis")
    return 13;
  else if (s.size() > 5 && s.substr(s.size() - 6, 6) == "inites")
    return 23;
  return 0;
}
bool test2(const vector<int> &v, int a, int b) {
  for (int i = 0; i < v.size(); i++) {
    if (v[i] < a || v[i] > b) {
      return false;
    }
  }
  return true;
}
bool test3(vector<int> v) {
  int p = 0;
  while (!v.empty()) {
    if (v[0] % 10 == 1) {
      p++;
      v.erase(v.begin());
    } else
      break;
  }
  if (v.empty()) return false;
  int g = 0;
  while (!v.empty()) {
    if (v[0] % 10 == 2) {
      g++;
      v.erase(v.begin());
    } else
      break;
    if (g > 1) return false;
  }
  if (g != 1) return false;
  int s = 0;
  while (!v.empty()) {
    if (v[0] % 10 == 3) {
      v.erase(v.begin());
    } else
      break;
  }
  if (!v.empty()) return false;
  return true;
}
int main() {
  testPetr("lios");
  vector<int> partspeech;
  for (;;) {
    string s;
    cin >> s;
    if (s.empty()) break;
    int ans = testPetr(s);
    if (ans != 0) {
      partspeech.push_back(ans);
    } else {
      cout << "NO";
      return 0;
    }
  }
  if (partspeech.size() == 1 ||
      (test2(partspeech, 10, 20) && test3(partspeech)) ||
      (test2(partspeech, 20, 30) && test3(partspeech)))
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
