#include <bits/stdc++.h>
using namespace std;
char str[100005];
char s[100005];
int main() {
  while (gets(str)) {
    stringstream ss(str);
    bool ok = true;
    int flag1 = false, flag2 = false, flag3 = false, flag4 = false;
    bool first = true;
    int gender = -1;
    int cnt = 0;
    while (ss >> s) {
      if (!ok) continue;
      int len = strlen(s);
      if (first) {
        first = false;
        if (len >= 4 && strcmp(s + len - 4, "lios") == 0) {
          gender = 0;
          flag1 = true;
          continue;
        }
        if (len >= 3 && strcmp(s + len - 3, "etr") == 0) {
          gender = 0;
          flag2 = true;
          continue;
        }
        if (len >= 6 && strcmp(s + len - 6, "initis") == 0) {
          gender = 0;
          flag3 = true;
          continue;
        }
        if (len >= 5 && strcmp(s + len - 5, "liala") == 0) {
          gender = 1;
          flag1 = true;
          continue;
        }
        if (len >= 4 && strcmp(s + len - 4, "etra") == 0) {
          gender = 1;
          flag2 = true;
          continue;
        }
        if (len >= 6 && strcmp(s + len - 6, "inites") == 0) {
          gender = 1;
          flag3 = true;
          continue;
        }
        ok = false;
        continue;
      }
      if (flag1) {
        if (gender == 0) {
          if (len >= 4 && strcmp(s + len - 4, "lios") == 0) {
            flag1++;
            continue;
          }
          if (len >= 3 && strcmp(s + len - 3, "etr") == 0) {
            flag1 = false;
            flag2 = true;
            continue;
          }
          if (len >= 6 && strcmp(s + len - 6, "initis") == 0) {
            ok = false;
            continue;
          }
          ok = false;
          continue;
        }
        if (gender == 1) {
          if (len >= 5 && strcmp(s + len - 5, "liala") == 0) {
            flag1++;
            continue;
          }
          if (len >= 4 && strcmp(s + len - 4, "etra") == 0) {
            flag1 = false;
            flag2 = true;
            continue;
          }
          if (len >= 6 && strcmp(s + len - 6, "inites") == 0) {
            ok = false;
            continue;
          }
          ok = false;
          continue;
        }
      }
      if (flag2) {
        if (gender == 0) {
          if (len >= 4 && strcmp(s + len - 4, "lios") == 0) {
            ok = false;
            continue;
          }
          if (len >= 3 && strcmp(s + len - 3, "etr") == 0) {
            ok = false;
            continue;
          }
          if (len >= 6 && strcmp(s + len - 6, "initis") == 0) {
            flag2 = false;
            flag3 = true;
            flag4 = true;
            continue;
          }
          ok = false;
          continue;
        }
        if (gender == 1) {
          if (len >= 5 && strcmp(s + len - 5, "liala") == 0) {
            ok = false;
            continue;
          }
          if (len >= 4 && strcmp(s + len - 4, "etra") == 0) {
            ok = false;
            continue;
          }
          if (len >= 6 && strcmp(s + len - 6, "inites") == 0) {
            flag2 = false;
            flag3 = true;
            flag4 = true;
            continue;
          }
          ok = false;
          continue;
        }
      }
      if (flag3) {
        if (gender == 0) {
          if (len >= 4 && strcmp(s + len - 4, "lios") == 0) {
            ok = false;
            continue;
          }
          if (len >= 3 && strcmp(s + len - 3, "etr") == 0) {
            ok = false;
            continue;
          }
          if (len >= 6 && strcmp(s + len - 6, "initis") == 0) {
            if (!flag4) ok = false;
            continue;
          }
          ok = false;
          continue;
        }
        if (gender == 1) {
          if (len >= 5 && strcmp(s + len - 5, "liala") == 0) {
            ok = false;
            continue;
          }
          if (len >= 4 && strcmp(s + len - 4, "etra") == 0) {
            ok = false;
            continue;
          }
          if (len >= 6 && strcmp(s + len - 6, "inites") == 0) {
            if (!flag4) ok = false;
            continue;
          }
          ok = false;
          continue;
        }
        continue;
      }
    }
    if (ok && flag1 <= 1)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
