#include <bits/stdc++.h>
using namespace std;
using namespace std;
long long int ans = 0;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  ans += a / b;
  return gcd(b, a % b);
}
long long int mod = 1000000007;
long long int binpower(long long int a, long long int b) {
  long long int ans = 1;
  while (b > 0) {
    if (b & 1) ans = (ans * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return ans;
}
bool isPrime(int n) {
  for (int i = 2; i * i <= n; ++i) {
    if (n % i == 0) return false;
  }
  return true;
}
const int N = 100005;
int n, l;
int arr[N];
char s[N];
bool solve() {
  for (int i = 0; i < n; ++i) {
    if (arr[i] == -1) return 0;
  }
  if (n == 1) return 1;
  for (int i = 1; i < n; ++i) {
    if (arr[i] % 2 != arr[0] % 2) return 0;
  }
  int a = 0, b = 0, c = 0;
  int i = 0;
  while (i < n && arr[i] / 2 == 0) {
    i++;
    a++;
  }
  while (i < n && arr[i] / 2 == 1) {
    i++;
    b++;
  }
  while (i < n && arr[i] / 2 == 2) {
    i++;
    c++;
  }
  if (i != n) return 0;
  if (b != 1)
    return 0;
  else
    return 1;
}
int main() {
  for (;;) {
    n = 0;
    while (cin >> s) {
      l = strlen(s);
      arr[n] = -1;
      if (!(strcmp(s + l - 4, "lios"))) arr[n] = 0;
      if (!strcmp(s + l - 5, "liala")) arr[n] = 1;
      if (!strcmp(s + l - 3, "etr")) arr[n] = 2;
      if (!strcmp(s + l - 4, "etra")) arr[n] = 3;
      if (!strcmp(s + l - 6, "initis")) arr[n] = 4;
      if (!strcmp(s + l - 6, "inites")) arr[n] = 5;
      n++;
    }
    if (n == 0) break;
    bool re = solve();
    if (re)
      cout << "YES";
    else
      cout << "NO";
  }
  return 0;
}
