#include <bits/stdc++.h>
using namespace std;
string s;
int a[3][2];
int kq = 0, noun = 0;
bool bang(string u, string v) {
  if (u.length() != v.length()) return false;
  for (int i = 0; i < u.length(); i++)
    if (u[i] != v[i]) return false;
  return true;
}
void change(string x, int &u, int &v) {
  if (bang(x, "lios")) {
    u = 1;
    v = 1;
    return;
  }
  if (bang(x, "liala")) {
    u = 1;
    v = 2;
    return;
  }
  if (bang(x, "etr")) {
    u = 2;
    v = 1;
    return;
  }
  if (bang(x, "etra")) {
    u = 2;
    v = 2;
    return;
  }
  if (bang(x, "initis")) {
    u = 3;
    v = 1;
    return;
  }
  if (bang(x, "inites")) {
    u = 3;
    v = 2;
    return;
  }
  u = 0;
  v = 0;
  return;
}
string copy(string x, int sl) {
  string ss = "";
  for (int i = sl; i > 0; i--) ss += x[x.length() - i];
  return ss;
}
void find(string x, int &u, int &v) {
  u = 0;
  v = 0;
  for (int i = 3; i <= 6; i++)
    if (i <= x.length()) {
      string ss = copy(x, i);
      change(ss, u, v);
      if (u != 0) return;
    }
}
void go(int pos, int c, int cnt, int gen) {
  if (c == 2) noun = 1;
  if (c == 2 && cnt > 1) {
    kq = 1;
    return;
  }
  if (pos >= s.length()) {
    if (c == 1) kq = 1;
    return;
  }
  int i = pos;
  string ss = "";
  while (i < s.length() && s[i] != ' ') {
    ss += s[i];
    i++;
  }
  int u, v;
  find(ss, u, v);
  if ((c == 1 && u == 3) || (c > u) || (u == 0)) {
    kq = 1;
    return;
  }
  if (gen == 0)
    gen = v;
  else if (gen != v) {
    kq = 1;
    return;
  }
  if (c == u)
    cnt++;
  else {
    c = u;
    cnt = 1;
  }
  go(i + 1, c, cnt, gen);
}
int main() {
  getline(cin, s);
  int trong = 0;
  for (int i = 0; i < s.length(); i++)
    if (s[i] == ' ') {
      trong++;
      break;
    }
  if (trong == 0) {
    int u, v;
    find(s, u, v);
    if (u == 0)
      cout << "NO";
    else
      cout << "YES";
    return 0;
  }
  go(0, 0, 0, 0);
  if (noun == 0) kq = 1;
  if (kq == 0)
    cout << "YES";
  else
    cout << "NO";
}
