#include <bits/stdc++.h>
using namespace std;
pair<int, int> checkTail(string word) {
  if (word.find("soil") == 0) {
    return make_pair(0, 2);
  } else if (word.find("rte") == 0) {
    return make_pair(0, 3);
  } else if (word.find("sitini") == 0) {
    return make_pair(0, 4);
  } else if (word.find("alail") == 0) {
    return make_pair(1, 2);
  } else if (word.find("arte") == 0) {
    return make_pair(1, 3);
  } else if (word.find("setini") == 0) {
    return make_pair(1, 4);
  }
  return make_pair(-1, 0);
}
int main() {
  string input;
  getline(cin, input);
  vector<string> words;
  char* token = NULL;
  char* str = (char*)input.c_str();
  token = strtok(str, " ");
  while (token != NULL) {
    words.push_back(string(token));
    token = strtok(NULL, " ");
  }
  bool genderFlag = true;
  bool adjCheck = false;
  bool nounCheck = false;
  bool verbCheck = false;
  bool result = true;
  int nounCnt = 0;
  for (int i = 0, len = words.size(); i < len; i++) {
    string word = words[i];
    reverse(word.begin(), word.end());
    pair<int, int> check = checkTail(word);
    if (check.first == 0) {
      if (i > 0 && !genderFlag) {
        result = false;
        break;
      }
      genderFlag = true;
    } else if (check.first == 1) {
      if (i > 0 && genderFlag) {
        result = false;
        break;
      }
      genderFlag = false;
    } else if (check.first == -1) {
      result = false;
      break;
    }
    if (i == 0) {
      if (check.second == 2) {
        adjCheck = true;
      } else if (check.second == 3) {
        nounCnt++;
        nounCheck = true;
      } else if (check.second == 4) {
        verbCheck = true;
      }
    } else {
      if (check.second == 2) {
        if (nounCheck || verbCheck) {
          result = false;
          break;
        }
        adjCheck = true;
      } else if (check.second == 3) {
        if (!adjCheck) {
          result = false;
          break;
        }
        nounCnt++;
        nounCheck = true;
      } else if (check.second == 4) {
        if (!nounCheck) {
          result = false;
          break;
        }
        verbCheck = true;
      }
    }
  }
  if (adjCheck) {
    if (words.size() > 1 && !nounCheck) result = false;
  }
  if (nounCnt > 1) result = false;
  if (result) {
    cout << "YES" << '\n';
  } else {
    cout << "NO" << '\n';
  }
  return 0;
}
