#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[100000];
  int m[100000], r[100000], k = 0;
  while (cin >> s) {
    bool ok = false;
    if (strlen(s) < 3) {
      cout << "NO";
      return 0;
    }
    int p = strlen(s) - 1;
    if (p + 1 > 3) {
      if (s[p] == 's' && s[p - 1] == 'o' && s[p - 2] == 'i' &&
          s[p - 3] == 'l') {
        k++;
        ok = true;
        m[k] = 1;
        r[k] = 1;
      }
    }
    if (p + 1 > 4) {
      if (s[p] == 'a' && s[p - 1] == 'l' && s[p - 2] == 'a' &&
          s[p - 3] == 'i' && s[p - 4] == 'l') {
        k++;
        ok = true;
        m[k] = 1;
        r[k] = 0;
      }
    }
    if (p + 1 > 2) {
      if (s[p] == 'r' && s[p - 1] == 't' && s[p - 2] == 'e') {
        k++;
        ok = true;
        m[k] = 2;
        r[k] = 1;
      }
    }
    if (p + 1 > 3) {
      if (s[p] == 'a' && s[p - 1] == 'r' && s[p - 2] == 't' &&
          s[p - 3] == 'e') {
        k++;
        ok = true;
        m[k] = 2;
        r[k] = 0;
      }
    }
    if (p + 1 > 5) {
      if (s[p] == 's' && s[p - 1] == 'i' && s[p - 2] == 't' &&
          s[p - 3] == 'i' && s[p - 4] == 'n' && s[p - 5] == 'i') {
        k++;
        ok = true;
        m[k] = 3;
        r[k] = 1;
      }
    }
    if (p + 1 > 5) {
      if (s[p] == 's' && s[p - 1] == 'e' && s[p - 2] == 't' &&
          s[p - 3] == 'i' && s[p - 4] == 'n' && s[p - 5] == 'i') {
        k++;
        ok = true;
        m[k] = 3;
        r[k] = 0;
      }
    }
    if (!ok) {
      cout << "NO";
      return 0;
    }
  }
  if (k == 1) {
    cout << "YES";
    return 0;
  }
  for (int i = 2; i <= k; i++)
    if (m[i] < m[i - 1]) {
      cout << "NO";
      return 0;
    }
  int kpr = 0, ks = 0, kgl = 0;
  for (int i = 1; i <= k; i++) (m[i] == 1) ? kpr++ : (m[i] == 2) ? ks++ : kgl++;
  if (ks != 1) {
    cout << "NO";
    return 0;
  }
  int muz = 0, zh = 0;
  for (int i = 1; i <= k; i++) (r[i] == 1) ? muz++ : zh++;
  if (muz > 0 && zh > 0) {
    cout << "NO";
    return 0;
  }
  cout << "YES";
}
