#include <bits/stdc++.h>   using namespace std;   string s[100000];   int u = 0;   char nonu[2][5] = { etr ,  etra };   int nonul[2] = {3, 4};   char adj[2][10] = { lios ,  liala };   int adjl[2] = {4, 5};   char ver[2][10] = { initis ,  inites };   int verl[2] = {6, 6};   bool isn(int v, int &u) {     int len = s[v].length();     for (int j = 0; j < 2; j++)       if (len >= nonul[j]) {         bool f = false;         for (int i = 0; i < nonul[j]; i++)           if (s[v][len - nonul[j] + i] != nonu[j][i]) {             f = true;             break;           }         if (!f) {           u = j;           return true;         }       }     return false;   }   bool judge(int v) {     int len = s[v].length();     for (int j = 0; j < 2; j++)       if (len >= nonul[j]) {         bool f = false;         for (int i = 0; i < nonul[j]; i++)           if (s[v][len - nonul[j] + i] != nonu[j][i]) {             f = true;             break;           }         if (!f) return true;       }     for (int j = 0; j < 2; j++)       if (len >= adjl[j]) {         bool f = false;         for (int i = 0; i < adjl[j]; i++)           if (s[v][len - adjl[j] + i] != adj[j][i]) {             f = true;             break;           }         if (!f) return true;       }     for (int j = 0; j < 2; j++)       if (len >= verl[j]) {         bool f = false;         for (int i = 0; i < verl[j]; i++)           if (s[v][len - verl[j] + i] != ver[j][i]) {             f = true;             break;           }         if (!f) return true;       }     return false;   }   bool judge1(int v, int u) {     int len = s[v].length();     for (int j = 0; j < 2; j++)       if (len >= adjl[j]) {         bool f = false;         for (int i = 0; i < adjl[j]; i++)           if (s[v][len - adjl[j] + i] != adj[j][i]) {             f = true;             break;           }         if (!f) {           if (j != u)             return false;           else             return true;         }       }     for (int j = 0; j < 2; j++)       if (len >= verl[j]) {         bool f = false;         for (int i = 0; i < verl[j]; i++)           if (s[v][len - verl[j] + i] != ver[j][i]) {             f = true;             break;           }         if (!f) return false;       }     return false;   }   bool judge2(int v, int u) {     int len = s[v].length();     for (int j = 0; j < 2; j++)       if (len >= adjl[j]) {         bool f = false;         for (int i = 0; i < adjl[j]; i++)           if (s[v][len - adjl[j] + i] != adj[j][i]) {             f = true;             break;           }         if (!f) return false;       }     for (int j = 0; j < 2; j++)       if (len >= verl[j]) {         bool f = false;         for (int i = 0; i < verl[j]; i++)           if (s[v][len - verl[j] + i] != ver[j][i]) {             f = true;             break;           }         if (!f) {           if (j != u)             return false;           else             return true;         }       }     return false;   }   int main() {     int n = 0;     while (cin >> s[n]) n++;     if (n == 1 && judge(0)) {       cout <<  YES  << endl;       return 0;     }     bool f = false;     int y = 0;     for (int i = 0; i < n; i++)       if (isn(i, u)) {         y = i;         if (!f)           f = true;         else {           cout <<  NO  << endl;           return 0;         }       }     if (!f) {       cout <<  NO  << endl;       return 0;     }     for (int i = 0; i < y; i++)       if (!judge1(i, u)) {         cout <<  NO  << endl;         return 0;       }     for (int i = y + 1; i < n; i++)       if (!judge2(i, u)) {         cout <<  NO  << endl;         return 0;       }     cout <<  YES  << endl;   }   