#include <bits/stdc++.h>
using namespace std;
int main() {
  map<string, int> m;
  m["lios"] = 1;
  m["etr"] = 2;
  m["initis"] = 3;
  map<string, int> f;
  f["liala"] = 4;
  f["etra"] = 5;
  f["inites"] = 6;
  bool noun = false;
  string line;
  string ans = "YES";
  string t;
  int masc = 3;
  string y;
  getline(cin, y);
  stringstream ss;
  ss << y;
  int in = 0;
  bool first = true;
  while (ss >> line) {
    reverse(line.begin(), line.end());
    if (first) {
      first = false;
      t = line.substr(0, 5);
      reverse(t.begin(), t.end());
      if (f[t] == 4) {
        ans = "YES";
        in = 1;
        masc = false;
      } else {
        t = line.substr(0, 4);
        reverse(t.begin(), t.end());
        if (f[t] == 5) {
          ans = "YES";
          masc = false;
          noun = true;
        } else {
          t = line.substr(0, 6);
          reverse(t.begin(), t.end());
          if (f[t] == 6) {
            in = 2;
            ans = "YES";
            masc = false;
          } else
            ans = "NO";
        }
      }
      if (masc == 3) {
        t = line.substr(0, 4);
        reverse(t.begin(), t.end());
        if (m[t] == 1) {
          in = 1;
          ans = "YES";
          masc = true;
        } else {
          t = line.substr(0, 3);
          reverse(t.begin(), t.end());
          if (m[t] == 2) {
            ans = "YES";
            masc = true;
            noun = true;
          } else {
            t = line.substr(0, 6);
            reverse(t.begin(), t.end());
            if (m[t] == 3) {
              in = 2;
              ans = "YES";
              masc = true;
            } else {
              ans = "NO";
            }
          }
        }
      }
    } else {
      if (in == 2) {
        ans = "NO";
        break;
      }
      in = false;
      if (masc) {
        in = false;
        if (noun) {
          t = line.substr(0, 6);
          reverse(t.begin(), t.end());
          if (m[t] == 3) {
            ans = "YES";
          } else {
            ans = "NO";
            break;
          }
        } else {
          t = line.substr(0, 3);
          reverse(t.begin(), t.end());
          if (m[t] == 2) {
            ans = "YES";
            noun = true;
          } else {
            t = line.substr(0, 4);
            reverse(t.begin(), t.end());
            if (m[t] != 1) {
              ans = "NO";
              break;
            }
          }
        }
      } else {
        if (noun) {
          t = line.substr(0, 6);
          reverse(t.begin(), t.end());
          if (f[t] == 6) {
            ans = "YES";
          } else {
            ans = "NO";
            break;
          }
        } else {
          t = line.substr(0, 4);
          reverse(t.begin(), t.end());
          if (f[t] == 5) {
            noun = true;
            ans = "YES";
          } else {
            t = line.substr(0, 5);
            reverse(t.begin(), t.end());
            if (f[t] != 4) {
              ans = "NO";
              break;
            }
          }
        }
      }
    }
  }
  if ((noun && ans == "YES") || (in && ans == "YES"))
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
