#include <bits/stdc++.h>
using namespace std;
int b[55555];
int suff(string s1, int t1) {
  string s2;
  if (s1[t1] == 'l') {
    if (s1[t1 + 4] == ' ') {
      s2 = s1.substr(t1, 4);
      if (s2 == "lios") {
        return 0;
      }
    }
    if (s1[t1 + 5] == ' ') {
      s2 = s1.substr(t1, 5);
      if (s2 == "liala") {
        return 1;
      }
    }
  }
  if (s1[t1] == 'e') {
    if (s1[t1 + 3] == ' ') {
      s2 = s1.substr(t1, 3);
      if (s2 == "etr") {
        return 2;
      }
    }
    if (s1[t1 + 4] == ' ') {
      s2 = s1.substr(t1, 4);
      if (s2 == "etra") {
        return 3;
      }
    }
  }
  if (s1[t1] == 'i') {
    if (s1[t1 + 6] == ' ') {
      s2 = s1.substr(t1, 6);
      if (s2 == "initis") {
        return 4;
      } else if (s2 == "inites") {
        return 5;
      }
    }
  }
  return -1;
}
int main() {
  string s;
  int w = 0;
  getline(cin, s);
  s += ' ';
  for (int t = 0; t < s.size(); t++) {
    if (s[t] == ' ') {
      if (w != 0 && (b[w] < b[w - 1] || b[w] % 2 != b[w - 1] % 2)) {
        cout << "NO";
        return 0;
      }
      if (b[w] == -1) {
        cout << "NO";
        return 0;
      }
      w++;
    }
    b[w] = suff(s, t);
    if (b[w] == 0) {
      t += 3;
    } else if (b[w] == 1) {
      t += 4;
    } else if (b[w] == 2) {
      t += 2;
    } else if (b[w] == 3) {
      t += 3;
    } else if (b[w] != -1) {
      t += 5;
    }
  }
  w--;
  if (w == 0) {
    cout << "YES";
    return 0;
  }
  for (int t = 0; t <= w; t++) {
    if (b[t] == 2 || b[t] == 3) {
      if (b[t + 1] != b[t]) {
        cout << "YES";
        return 0;
      }
      break;
    }
  }
  cout << "NO";
  return 0;
}
