#include <bits/stdc++.h>
using namespace std;
string mas[100008];
int a[100008];
int b[100008];
string m[3] = {"lios", "etr", "initis"};
string w[3] = {"liala", "etra", "inites"};
int sufix(string t, int pos) {
  for (int i = 0; i < 3; i++) {
    if (t.size() >= m[i].size()) {
      int d = t.size() - m[i].size();
      bool b1 = true;
      for (int j = m[i].size() - 1; j >= 0; j--) {
        if (m[i][j] != t[j + d]) {
          b1 = false;
          break;
        }
      }
      if (b1) {
        a[pos] = i;
        b[pos] = 1;
        return 1;
      }
    }
  }
  for (int i = 0; i < 3; i++) {
    if (t.size() >= w[i].size()) {
      int d = t.size() - w[i].size();
      bool b1 = true;
      for (int j = w[i].size() - 1; j >= 0; j--) {
        if (w[i][j] != t[j + d]) {
          b1 = false;
          break;
        }
      }
      if (b1) {
        a[pos] = i;
        b[pos] = -1;
        return -1;
      }
    }
  }
  return 0;
}
int f(string& a1) {
  string temp;
  int j = 0;
  while (!a1.empty()) {
    temp.clear();
    while (!a1.empty() && a1[0] != ' ') {
      temp += a1[0];
      a1.erase(0, 1);
    }
    mas[j] = temp;
    a1.erase(0, 1);
    j++;
  }
  return j;
}
int main() {
  string a1, temp;
  getline(cin, a1);
  int j = f(a1);
  if (j == 1) {
    if (!sufix(mas[j - 1], j - 1)) {
      cout << "NO";
      return 0;
    } else {
      cout << "YES";
      return 0;
    }
  } else {
    for (int i = 0; i < j; i++) {
      sufix(mas[i], i);
    }
    while (1) {
      int i = 0;
      while (i < j && b[i + 1] == b[i]) i++;
      if (i == j - 1) {
        int k = 0;
        while (k < j && a[k] != 1) k++;
        if (k == j) {
          cout << "NO";
          return 0;
        }
        for (int t = 0; t < k; t++) {
          if (a[t] != 0) {
            cout << "NO";
            return 0;
          }
        }
        for (int t = k + 1; t < j; t++) {
          if (a[t] != 2) {
            cout << "NO";
            return 0;
          }
        }
        cout << "YES";
        return 0;
      } else {
        cout << "NO";
        return 0;
      }
    }
  }
}
