#include <bits/stdc++.h>
using namespace std;
bool cmp(pair<int, int> a, pair<int, int> b) { return a.second > b.second; }
void showvd(vector<double> v) {
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) cout << v[i] << " " << endl;
}
void showvi(vector<int> v) {
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << endl;
}
void showvl(vector<long long> v) {
  for (int i = 0; i < v.size(); i++)
    cout << v[i] << " "
         << " ";
  cout << endl;
}
void showvp(vector<pair<int, int> > v) {
  for (int i = 0; i < v.size(); i++)
    cout << v[i].first << " " << v[i].second << endl;
}
long long fastpower(long long a, long long n, long long p) {
  long long ans = 1;
  while (n > 0) {
    if (n & 1) ans = (ans * a) % p;
    a = (a * a) % p;
    n = n >> 1;
  }
  return ans % p;
}
vector<bool> prime(1001, true);
void SOE(int n) {
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
}
void factor(int n, vector<int> &v) {
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      v.push_back(i);
      int z = n / i;
      if (z != i) v.push_back(z);
    }
  }
}
int chk(string second) {
  int n = second.length();
  if (second[n - 1] == 'r')
    return 1;
  else if (second[n - 1] == 's') {
    if (second[n - 2] == 'e')
      return 0;
    else
      return 1;
  } else
    return 0;
}
int chk1(string second) {
  int n = second.length();
  if (second[n - 1] == 'r')
    return 1;
  else if (second[n - 1] == 's') {
    if (second[n - 2] == 'o')
      return 0;
    else
      return 2;
  } else if (second[n - 2] == 'l')
    return 0;
  else
    return 1;
}
int chh(string second) {
  int n = second.length();
  if (n < 3) return 0;
  string tmp = second.substr(n - 3, 3);
  if (tmp == "etr") return 1;
  if (n > 3) {
    tmp = second.substr(n - 4, 4);
    if (tmp == "etra" || tmp == "lios") return 1;
    if (n > 4) {
      tmp = second.substr(n - 5, 5);
      if (tmp == "liala") return 1;
      if (n > 5) {
        tmp = second.substr(n - 6, 6);
        if (tmp == "initis" || tmp == "inites") return 1;
      }
    }
  }
  return 0;
}
void solve() {
  int n;
  string second;
  getline(cin, second);
  vector<string> v;
  for (int i = 0; i < second.size(); i++) {
    string a;
    while (i < second.size() && second[i] != ' ') a += second[i++];
    v.push_back(a);
    if (chh(a) == 0) {
      cout << "NO" << endl;
      return;
    }
    n++;
  }
  n = v.size();
  if (n == 1) {
    cout << "YES" << endl;
    return;
  }
  int z = 0;
  for (int i = 0; i < n; i++) {
    z += chk(v[i]);
  }
  if (z == 0 || z == n) {
    int i = 0, fg = 0;
    int a = 0, no = 0, vb = 0;
    while (i < n && chk1(v[i]) == 0) {
      a++;
      i++;
    }
    while (i < n && chk1(v[i]) == 1) {
      no++;
      i++;
    }
    while (i < n && chk1(v[i]) == 2) {
      vb++;
      i++;
    }
    if (i != n) {
      fg = 1;
    } else if (no == 0) {
      if (a != 0 || vb != 0) {
        fg = 1;
      }
    } else if (no != 1) {
      fg = 1;
    }
    if (fg == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  } else
    cout << "NO" << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  for (int i = 0; i < t; i++) {
    solve();
  }
  return 0;
}
