#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
void ingraph(vector<long long> graph[], long long m) {
  long long x, y;
  for (long long i = 0; i < m; i++) {
    cin >> x >> y;
    x--, y--;
    graph[x].push_back(y);
    graph[y].push_back(x);
  }
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
long long modmulti(long long a, long long b) {
  return ((a % mod) * 1ll * (b % mod)) % mod;
}
long long modadd(long long a, long long b) {
  long long asdfgh = ((a % mod) + (b % mod) + mod + mod) % mod;
  asdfgh = (asdfgh + mod) % mod;
  return asdfgh;
}
long long modpower(long long a, long long n) {
  if (n == 0) return 1;
  if (n == 1) return a % mod;
  long long b = modpower(a, n / 2);
  b = modmulti(b, b);
  if (n % 2 == 0) return b;
  return modmulti(a, b);
}
long long modinv(long long a) { return modpower(a, mod - 2); }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  string men[3] = {"soil", "rte", "sitini"},
         woman[3] = {"alail", "arte", "setini"};
  string str;
  getline(cin, str);
  vector<string> vec;
  string s;
  for (long long i = 0; i < (long long)(str).size(); i++) {
    if (str[i] == ' ') {
      vec.push_back(s);
      s = "";
    } else
      s += str[i];
  }
  vec.push_back(s);
  string t = "";
  long long p = (long long)(vec[0]).size();
  t = vec[0][p - 2];
  t += vec[0][p - 1];
  long long f = 0;
  if (t == "la" || t == "ra" || t == "es") f++;
  long long ans = 0;
  for (long long i = 0; i < (long long)(vec).size(); i++)
    reverse((vec[i]).begin(), (vec[i]).end());
  if (f == 0) {
    long long i = 0;
    long long f = 0;
    long long j = 0;
    while (i < (long long)(vec).size()) {
      t = "";
      for (long long k = 0;
           k < min((long long)(vec[i]).size(), (long long)(men[j]).size());
           k++) {
        t += vec[i][k];
      }
      if (j > 2) {
        f = 5;
        break;
      }
      if ((long long)(vec).size() == 1 && t == men[j]) {
        ans++;
        break;
      }
      if (j == 1 && t == men[j]) {
        i++;
        f++;
      } else if (t == men[j])
        i++;
      else {
        j++;
      }
    }
    if (i == (long long)(vec).size() && f == 1) ans++;
  } else {
    long long i = 0;
    long long f = 0;
    long long j = 0;
    while (i < (long long)(vec).size()) {
      t = "";
      for (long long k = 0;
           k < min((long long)(vec[i]).size(), (long long)(woman[j]).size());
           k++) {
        t += vec[i][k];
      }
      if (j > 2) {
        f = 5;
        break;
      }
      if ((long long)(vec).size() == 1 && t == woman[j]) {
        ans++;
        break;
      }
      if (j == 1 && t == woman[j]) {
        i++;
        f++;
      } else if (t == woman[j])
        i++;
      else {
        j++;
      }
    }
    if (i == (long long)(vec).size() && f == 1) ans++;
  }
  if ((long long)(vec).size() == 1) {
  }
  if (ans != 0)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
