#include <bits/stdc++.h>
using namespace std;
bool belong[100010];
int type[100010];
bool mark[100010];
int main() {
  string a;
  int index = 0;
  memset(mark, 0, sizeof(mark));
  while (cin >> a) {
    int len = a.size() - 1;
    if (a[len] == 's') {
      if (len - 3 >= 0 && a[len - 1] == 'o' && a[len - 2] == 'i' &&
          a[len - 3] == 'l') {
        belong[index] = 0;
        type[index] = 1;
      } else if (len - 5 >= 0 && a[len - 1] == 'i' && a[len - 2] == 't' &&
                 a[len - 3] == 'i' && a[len - 4] == 'n' && a[len - 5] == 'i') {
        belong[index] = 0;
        type[index] = 3;
      } else if (len - 5 >= 0 && a[len - 1] == 'e' && a[len - 2] == 't' &&
                 a[len - 3] == 'i' && a[len - 4] == 'n' && a[len - 5] == 'i') {
        belong[index] = 1;
        type[index] = 3;
      } else
        mark[index] = 1;
    } else if (a[len] == 'a') {
      if (len - 4 >= 0 && a[len - 1] == 'l' && a[len - 2] == 'a' &&
          a[len - 3] == 'i' && a[len - 4] == 'l') {
        belong[index] = 1;
        type[index] = 1;
      } else if (len - 3 >= 0 && a[len - 1] == 'r' && a[len - 2] == 't' &&
                 a[len - 3] == 'e') {
        belong[index] = 1;
        type[index] = 2;
      } else
        mark[index] = 1;
    } else if (len - 2 >= 0 && a[len] == 'r' && a[len - 1] == 't' &&
               a[len - 2] == 'e') {
      belong[index] = 0;
      type[index] = 2;
    } else
      mark[index] = 1;
    index++;
  }
  if (index == 1 && mark[0] == 0) {
    cout << "YES" << endl;
    return 0;
  }
  bool T = 0;
  int cnt = 0;
  int pre = -1;
  for (int i = 0; i < index; ++i) {
    if (mark[i]) {
      T = 1;
      break;
    }
    if (pre == -1) {
      pre = i;
      if (type[i] == 2) cnt++;
      continue;
    }
    if (belong[i] != belong[pre]) {
      T = 1;
      break;
    }
    if (type[i] < type[pre]) {
      T = 1;
      break;
    }
    if (type[i] == 2) cnt++;
    pre = i;
  }
  if (cnt != 1) T = 1;
  if (T)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
  return 0;
}
