#include <bits/stdc++.h>
using namespace std;
char line[1000006];
vector<string> V;
int gr;
int pl;
bool adj(string str1) {
  int len = str1.length();
  if (len >= 4) {
    pl = 1;
    if (str1[len - 4] == 'l' & str1[len - 3] == 'i' && str1[len - 2] == 'o' &&
        str1[len - 1] == 's')
      return true;
  }
  if (len >= 5) {
    pl = 2;
    if (str1[len - 5] == 'l' & str1[len - 4] == 'i' && str1[len - 3] == 'a' &&
        str1[len - 2] == 'l' && str1[len - 1] == 'a')
      return true;
  }
  pl = 3;
  return false;
}
bool noun(string str1) {
  int len = str1.length();
  if (len >= 3) {
    pl = 1;
    if (str1[len - 3] == 'e' && str1[len - 2] == 't' && str1[len - 1] == 'r')
      return true;
  }
  if (len >= 4) {
    pl = 2;
    if (str1[len - 4] == 'e' & str1[len - 3] == 't' && str1[len - 2] == 'r' &&
        str1[len - 1] == 'a')
      return true;
  }
  pl = 3;
  return false;
}
bool verb(string str1) {
  int len = str1.length();
  if (len >= 6) {
    pl = 1;
    if (str1[len - 6] == 'i' & str1[len - 5] == 'n' && str1[len - 4] == 'i' &&
        str1[len - 3] == 't' && str1[len - 2] == 'i' && str1[len - 1] == 's')
      return true;
    pl = 2;
    if (str1[len - 6] == 'i' & str1[len - 5] == 'n' && str1[len - 4] == 'i' &&
        str1[len - 3] == 't' && str1[len - 2] == 'e' && str1[len - 1] == 's')
      return true;
  }
  pl = 3;
  return false;
}
int main() {
  gets(line);
  istringstream iss(line);
  string str1;
  while (iss >> str1) V.push_back(str1);
  if (V.size() == 1) {
    if (adj(str1) || verb(str1) || noun(str1)) {
      printf("YES\n");
      return 0;
    } else {
      printf("NO\n");
      return 0;
    }
  }
  if (V.size() > 0) {
    str1 = V[0];
    if (adj(str1)) {
      gr = pl;
      bool px = false;
      for (int i = 1; i < V.size(); i++) {
        if (adj(V[i])) {
          if (pl != gr) {
            printf("NO\n");
            return 0;
          }
          continue;
        } else if (noun(V[i])) {
          if (pl != gr) {
            printf("NO\n");
            return 0;
          }
          int j = i + 1;
          for (j = i + 1; j < V.size(); j++) {
            if (verb(V[j])) {
              if (pl != gr) {
                printf("NO\n");
                return 0;
              }
            } else {
              printf("NO\n");
              return 0;
            }
          }
          printf("YES\n");
          return 0;
        } else {
          printf("NO\n");
          return 0;
        }
      }
      printf("NO\n");
      return 0;
    } else if (noun(str1)) {
      gr = pl;
      for (int j = 1; j < V.size(); j++) {
        if (verb(V[j])) {
          if (pl != gr) {
            printf("NO\n");
            return 0;
          }
        } else {
          printf("NO\n");
          return 0;
        }
      }
      printf("YES\n");
      return 0;
    } else {
      printf("NO\n");
      return 0;
    }
  } else {
    printf("NO\n");
    return 0;
  }
  return 0;
}
