#include <bits/stdc++.h>
using namespace std;
const int kMaxn = 100007;
int cnt, a[kMaxn];
void Input() {
  cnt = 0;
  string s;
  while (cin >> s) {
    cnt++;
    string t = s;
    reverse(t.begin(), t.end());
    if (t.size() >= 4 && t.substr(0, 4) == "soil")
      a[cnt] = 1;
    else if (t.size() >= 5 && t.substr(0, 5) == "alail")
      a[cnt] = 2;
    else if (t.size() >= 3 && t.substr(0, 3) == "rte")
      a[cnt] = 3;
    else if (t.size() >= 4 && t.substr(0, 4) == "arte")
      a[cnt] = 4;
    else if (t.size() >= 6 && t.substr(0, 6) == "sitini")
      a[cnt] = 5;
    else if (t.size() >= 6 && t.substr(0, 6) == "setini")
      a[cnt] = 6;
    else
      a[cnt] = 7;
  }
}
void Solve() {
  for (int i = 1; i <= cnt; i++)
    if (a[i] == 7) {
      cout << "NO" << endl;
      return;
    } else if ((a[i] & 1) != (a[1] & 1)) {
      cout << "NO" << endl;
      return;
    }
  if (cnt == 1) {
    cout << "YES" << endl;
    return;
  }
  int i = 1;
  while (i <= cnt && (a[i] == 1 || a[i] == 2)) i++;
  int noun = 0;
  while (i <= cnt && (a[i] == 3 || a[i] == 4)) {
    noun++;
    i++;
  }
  if (noun != 1) {
    cout << "NO" << endl;
    return;
  }
  while (i <= cnt && (a[i] == 5 || a[i] == 6)) i++;
  if (i == cnt + 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
int main() {
  Input();
  Solve();
  return 0;
}
