#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
  int rod = 0, state = -1, t = 0, sus = 0;
  while (cin >> s) {
    bool ok = false;
    t++;
    string cmp = "";
    for (int i = int((s).size()) - 1, k = 1; i >= 0 && k < 7; i--, ++k) {
      cmp = s[i] + cmp;
      if (k == 3 && cmp == "etr") {
        if (state == 3 || state == 2) {
          cout << "NO" << endl;
          return 0;
        }
        sus = 1;
        state = 2;
        if (rod == 2) {
          cout << "NO" << endl;
          return 0;
        }
        rod = 1;
        ok = true;
        break;
      } else if (k == 4) {
        if (cmp == "lios") {
          if (state == 2 || state == 3) {
            cout << "NO" << endl;
            return 0;
          }
          state = 1;
          if (rod == 2) {
            cout << "NO" << endl;
            return 0;
          }
          rod = 1;
          ok = true;
          break;
        } else if (cmp == "etra") {
          if (state != -1 && state != 1) {
            cout << "NO" << endl;
            return 0;
          }
          sus = 1;
          state = 2;
          if (rod == 1) {
            cout << "NO" << endl;
            return 0;
          }
          rod = 2;
          ok = true;
          break;
        }
      } else if (k == 5 && cmp == "liala") {
        if (state == 2 || state == 3) {
          cout << "NO" << endl;
          return 0;
        }
        state = 1;
        if (rod == 1) {
          cout << "NO" << endl;
          return 0;
        }
        rod = 2;
        ok = true;
        break;
      } else if (k == 6) {
        if (cmp == "initis") {
          if (state == 1) {
            cout << "NO" << endl;
            return 0;
          }
          state = 3;
          if (rod == 2) {
            cout << "NO" << endl;
            return 0;
          }
          rod = 1;
          ok = true;
          break;
        } else if (cmp == "inites") {
          if (state == 1) {
            cout << "NO" << endl;
            return 0;
          }
          state = 3;
          if (rod == 1) {
            cout << "NO" << endl;
            return 0;
          }
          rod = 2;
          ok = true;
          break;
        }
      }
    }
    if (!ok) {
      cout << "NO" << endl;
      return 0;
    }
  }
  if (t > 1 && sus == 0) {
    cout << "NO" << endl;
  } else
    cout << "YES" << endl;
  return 0;
}
