#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T gcd(T a, T b) {
  if (a < 0) return gcd(-a, b);
  if (b < 0) return gcd(a, -b);
  return (b == 0) ? a : gcd(b, a % b);
}
template <class T>
inline T lcm(T a, T b) {
  if (a < 0) return lcm(-a, b);
  if (b < 0) return lcm(a, -b);
  return a * (b / gcd(a, b));
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
template <class T>
T power(T N, T P) {
  return (P == 0) ? 1 : N * power(N, P - 1);
}
template <class T>
bool inside(T a, T b, T c) {
  return (b >= a && b <= c);
}
const long long INF64 = (long long)1E18;
double _dist(double x1, double y1, double x2, double y2) {
  return sqrt(sqr(x1 - x2) + sqr(y1 - y2));
}
int distsq(int x1, int y1, int x2, int y2) {
  return sqr(x1 - x2) + sqr(y1 - y2);
}
long long toInt64(string s) {
  long long r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
double LOG(long long N, long long B) { return (log10l(N)) / (log10l(B)); }
string itoa(long long a) {
  if (a == 0) return "0";
  string ret;
  for (long long i = a; i > 0; i = i / 10) ret.push_back((i % 10) + 48);
  reverse(ret.begin(), ret.end());
  return ret;
}
vector<string> token(string a, string b) {
  const char *q = a.c_str();
  while (count(b.begin(), b.end(), *q)) q++;
  vector<string> oot;
  while (*q) {
    const char *e = q;
    while (*e && !count(b.begin(), b.end(), *e)) e++;
    oot.push_back(string(q, e));
    q = e;
    while (count(b.begin(), b.end(), *q)) q++;
  }
  return oot;
}
int isvowel(char s) {
  s = tolower(s);
  if (s == 'a' || s == 'e' || s == 'i' || s == 'o' || s == 'u') return 1;
  return 0;
}
int isupper(char s) {
  if (s >= 'A' and s <= 'Z') return 1;
  return 0;
}
template <class T>
struct Fraction {
  T a, b;
  Fraction(T a = 0, T b = 1);
  string toString();
};
template <class T>
Fraction<T>::Fraction(T a, T b) {
  T d = gcd(a, b);
  a /= d;
  b /= d;
  if (b < 0) a = -a, b = -b;
  this->a = a;
  this->b = b;
}
template <class T>
string Fraction<T>::toString() {
  ostringstream sout;
  sout << a << "/" << b;
  return sout.str();
}
template <class T>
Fraction<T> operator+(Fraction<T> p, Fraction<T> q) {
  return Fraction<T>(p.a * q.b + q.a * p.b, p.b * q.b);
}
template <class T>
Fraction<T> operator-(Fraction<T> p, Fraction<T> q) {
  return Fraction<T>(p.a * q.b - q.a * p.b, p.b * q.b);
}
template <class T>
Fraction<T> operator*(Fraction<T> p, Fraction<T> q) {
  return Fraction<T>(p.a * q.a, p.b * q.b);
}
template <class T>
Fraction<T> operator/(Fraction<T> p, Fraction<T> q) {
  return Fraction<T>(p.a * q.b, p.b * q.a);
}
int SET(int N, int pos) { return N = N | (1 << pos); }
int RESET(int N, int pos) { return N = N & ~(1 << pos); }
int check(int N, int pos) { return (N & (1 << pos)); }
int toggle(int N, int pos) {
  if (check(N, pos)) return N = RESET(N, pos);
  return N = SET(N, pos);
}
void PRINTBIT(int N) {
  printf("(");
  for (int i = 6; i >= 1; i--) {
    bool x = check(N, i);
    cout << x;
  }
  puts(")");
}
struct data {
  int sex, t;
  data(int a, int b) {
    t = a;
    sex = b;
  };
  data() {}
  void print() { printf("(%d %d)\n", sex, t); }
};
data check(string s) {
  reverse(s.begin(), s.end());
  string w;
  if (s.size() < 3) return data(0, 0);
  w = s.substr(0, 3);
  if (w == "rte") return data(2, 1);
  if (s.size() < 4) return data(0, 0);
  w = s.substr(0, 4);
  if (w == "soil") return data(1, 1);
  if (w == "arte") return data(2, 2);
  if (s.size() < 5) return data(0, 0);
  w = s.substr(0, 5);
  if (w == "alail") return data(1, 2);
  if (s.size() < 6) return data(0, 0);
  w = s.substr(0, 6);
  if (w == "sitini") return data(3, 1);
  if (w == "setini") return data(3, 2);
  return data(0, 0);
}
vector<data> v;
vector<string> vs;
int main() {
  string s;
  getline(cin, s);
  v.clear();
  vs.clear();
  int flag = 1;
  vs = token(s, " ");
  string w = "";
  for (__typeof(s.size()) i = 0; i < (s.size()); i++) {
    if (s[i] == ' ') {
      data temp = check(w);
      v.push_back(temp);
      if (temp.sex == 0) flag = 0;
      w = "";
    } else
      w += s[i];
  }
  data temp = check(w);
  v.push_back(temp);
  if (temp.sex == 0) flag = 0;
  w + "";
  if (flag == 0) {
    puts("NO");
    return 0;
  }
  if (v.size() == 1) {
    cout << "YES" << endl;
    return 0;
  }
  int pos = -1;
  for (__typeof(v.size()) i = 0; i < (v.size()); i++) {
    if (i and v[i].sex != v[i - 1].sex) flag = 0;
    if (v[i].t == 2) {
      if (pos == -1)
        pos = i;
      else
        flag = 0;
    }
  }
  if (pos == -1) flag = 0;
  if (flag == 0) {
    puts("NO");
    return 0;
  }
  for (int i = 0; i < pos; i++)
    if (v[i].t != 1) flag = 0;
  if (flag == 0) {
    puts("NO");
    return 0;
  }
  for (int i = pos + 1; i < (int)v.size(); i++)
    if (v[i].t != 3) flag = 0;
  if (flag == 0) {
    puts("NO");
    return 0;
  }
  if (flag == 1)
    puts("YES");
  else
    puts("NO");
}
