#include<bits/stdc++.h>
using namespace std;

int adjective(char gender, string s)
{
	string tm, tf;
	if(s.size()>=4)
	tm=s.substr(s.size()-4);
	if(s.size()>=5)
		tf=s.substr(s.size()-5);
	if(gender!='M' && gender!='F')
	{
		if(tm=="lios")
			return 1;
		if(tf=="liala")
			return 2;
		else
			return -1;
	}
	// cout<<tf<<endl;
	if(tm!="lios" && tf!="liala")
		return -1;

	// cout<<" gender In: ";
	if(gender=='M' && tm=="lios")
		return 1;
	if(gender=='F' && tf=="liala")
		return 2;
	cout<<tf<<endl;
	return -1;
}

int noun(char gender, string s)
{
	string tm, tf;
	if(s.size()>=3)
		tm=s.substr(s.size()-3);
	if(s.size()>=4)
		tf=s.substr(s.size()-4);
	if(gender!='M' && gender!='F')
	{
		if(tm=="etr")
			return 3;
		if(tf=="etra")
			return 4;
		else
			return -1;
	}
	if(tm!="etr" && tf!="etra")
		return -1;
	if(gender=='M' && tm=="etr")
		return 3;
	if(gender=='F' && tf=="etra")
		return 4;
	return -1;
}

int verb(char gender, string s)
{
	string tm, tf;
	if(s.size()>=6)
	{
		tm=s.substr(s.size()-6);
		tf=s.substr(s.size()-6);
	}

	if(gender!='M' && gender!='F')
	{
		if(tm=="initis")
			return 5;
		if(tf=="inites")
			return 6;
		else
			return -1;
	}
	if(tm!="initis" && tf!="inites")
		return -1;
	if(gender=='M' && tm=="initis")
		return 5;
	if(gender=='F' && tf=="inites")
		return 6;
	return -1;
}

int main()
{
	string s;
	int t=0;
	char gender='0';
	bool flag=true;
	while(cin>>s)
	{
		if(t==-1)
		{
			flag=false;
			break;
		}
		if(gender=='0')
		{
			t=adjective(gender,s);
			if(t==-1 && s.size())
				t=noun(gender,s);
			if(t==-1)
				t=verb(gender,s);
			if(t==-1)
				flag=false;
			else
				(t%2) ? (gender='M') : (gender='F');
		}
		else
		{
			if(t<=2)
			{
				t=adjective(gender, s);
				if(t==-1)
				{
					// cout<<"adj out ";
					t=noun(gender, s);
					if(t==-1)
					{
						// cout<<"Noun out ";
						t=verb(gender,s);
					}
				}
			}
			else if(t>=5)
				t=verb(gender,s);

		}
		// cout<<t<<gender<<endl;
	}
	(flag) ? (cout<<"YES") : (cout<<"NO");
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

int adjective(char gender, string s)
{
	string tm, tf;
	if(s.size()>=4)
	tm=s.substr(s.size()-4);
	if(s.size()>=5)
		tf=s.substr(s.size()-5);
	if(gender!='M' && gender!='F')
	{
		if(tm=="lios")
			return 1;
		if(tf=="liala")
			return 2;
		else
			return -1;
	}
	// cout<<tf<<endl;
	if(tm!="lios" && tf!="liala")
		return -1;

	// cout<<" gender In: ";
	if(gender=='M' && tm=="lios")
		return 1;
	if(gender=='F' && tf=="liala")
		return 2;
	cout<<tf<<endl;
	return -1;
}

int noun(char gender, string s)
{
	string tm, tf;
	if(s.size()>=3)
		tm=s.substr(s.size()-3);
	if(s.size()>=4)
		tf=s.substr(s.size()-4);
	if(gender!='M' && gender!='F')
	{
		if(tm=="etr")
			return 3;
		if(tf=="etra")
			return 4;
		else
			return -1;
	}
	if(tm!="etr" && tf!="etra")
		return -1;
	if(gender=='M' && tm=="etr")
		return 3;
	if(gender=='F' && tf=="etra")
		return 4;
	return -1;
}

int verb(char gender, string s)
{
	string tm, tf;
	if(s.size()>=6)
	{
		tm=s.substr(s.size()-6);
		tf=s.substr(s.size()-6);
	}

	if(gender!='M' && gender!='F')
	{
		if(tm=="initis")
			return 5;
		if(tf=="inites")
			return 6;
		else
			return -1;
	}
	if(tm!="initis" && tf!="inites")
		return -1;
	if(gender=='M' && tm=="initis")
		return 5;
	if(gender=='F' && tf=="inites")
		return 6;
	return -1;
}

int main()
{
	string s;
	int t=0;
	char gender='0';
	bool flag=true;
	bool nn=false;
	while(cin>>s)
	{
		if(t==-1)
		{
			flag=false;
			break;
		}
		if(gender=='0')
		{
			t=adjective(gender,s);
			if(t==-1 && s.size())
			{
				t=noun(gender,s);
				if(t!=-1)
					nn=true;
			}
			if(t==-1)
				t=verb(gender,s);

			if(t==-1)
				flag=false;
			else
				(t%2) ? (gender='M') : (gender='F');
		}
		else
		{
			if(t<=2)
			{
				t=adjective(gender, s);
				if(t==-1)
				{
					// cout<<"adj out ";
					t=noun(gender, s);
					if(t==-1)
					{
						flag=false;
						// cout<<"Noun out ";
						t=verb(gender,s);
					}
					else
						nn=true;
				}
			}
			// else if(t>2)
			// {
			// 	t=noun(gender, s);
			// 	t=verb(gender,s);
			// }
			else if(t>2)
			{
				if(nn)
					t=verb(gender,s);
				else
					t=-1;
			}

			if(t==-1)
			{
				flag=false;
				break;
			}

		}
		// cout<<t<<gender<<" "<<nn<<endl;
	}
	(flag) ? (cout<<"YES") : (cout<<"NO");
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl "\n"

const int N=100005;

vector<int> male[3];
vector<int> fe[3];

string ms[3]={"lios","etr","initis"};
string fs[3]={"liala","etra","inites"};

string s;
int n=0;
int m=0,f=0;

void check()
{
	int flag=0;
	for(int i=0;i<3;i++)
	{
		if(s.size()>=ms[i].size() && s.substr(s.size()-ms[i].size())==ms[i])
		{	male[i].push_back(n);m=1;flag=1;	}
	}
	for(int i=0;i<3;i++)
	{
		if(s.size()>=fs[i].size() && s.substr(s.size()-fs[i].size())==fs[i])
		{	fe[i].push_back(n);f=1;flag=1;		}
	}
	if(!flag)
	{
		cout<<"NO";
		exit(0);
	}
}

int32_t main()
{
	IOS;
	while(cin>>s)
	{
		check();
		n++;
	}
	if(m && f)
	{
		cout<<"NO";
		return 0;
	}
	int req[n];
	int cur=0,flag=1;
	for(int i=0;i<3;i++)
	{
		for(auto it:male[i])
		{
			if(it!=cur)
			{
				cout<<"NO";
				return 0;
			}
			else cur++;
		}
	}
	for(int i=0;i<3;i++)
	{
		for(auto it:fe[i])
		{
			if(it!=cur)
			{
				cout<<"NO";
				return 0;
			}
			else cur++;
		}
	}
	if((f && fe[1].size()>1 )||(f && fe[0].size() && fe[1].size()==0 && fe[2].size() )||(m && male[0].size() && male[1].size()>1 )||(m && male[1].size()==0 && male[2].size() ))
		cout<<"NO";
	else
		cout<<"YES";
 	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl "\n"

const int N=100005;

vector<int> male[3];
vector<int> fe[3];

string ms[3]={"lios","etr","initis"};
string fs[3]={"liala","etra","inites"};

string s;
int n=0;
int m=0,f=0;

void check()
{
	int flag=0;
	for(int i=0;i<3;i++)
	{
		if(s.size()>=ms[i].size() && s.substr(s.size()-ms[i].size())==ms[i])
		{	male[i].push_back(n);m=1;flag=1;	}
	}
	for(int i=0;i<3;i++)
	{
		if(s.size()>=fs[i].size() && s.substr(s.size()-fs[i].size())==fs[i])
		{	fe[i].push_back(n);f=1;flag=1;		}
	}
	if(!flag)
	{
		cout<<"NO";
		exit(0);
	}
}

int32_t main()
{
	IOS;
	while(cin>>s)
	{
		check();
		n++;
	}
	if(m && f)
	{
		cout<<"NO";
		return 0;
	}
	int req[n];
	int cur=0,flag=1;
	for(int i=0;i<3;i++)
	{
		for(auto it:male[i])
		{
			if(it!=cur)
			{
				cout<<"NO";
				return 0;
			}
			else cur++;
		}
	}
	for(int i=0;i<3;i++)
	{
		for(auto it:fe[i])
		{
			if(it!=cur)
			{
				cout<<"NO";
				return 0;
			}
			else cur++;
		}
	}
	if((f && fe[0].size() && fe[1].size()!=1 )||(f && fe[0].size() && fe[1].size()==0 && fe[2].size() )||(m && male[0].size() && male[1].size()!=1 )||(m && male[0].size() && male[1].size()==0 && male[2].size() ))
		cout<<"NO";
	else
		cout<<"YES";
 	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl "\n"

const int N=100005;

vector<int> male[3];
vector<int> fe[3];

string ms[3]={"lios","etr","initis"};
string fs[3]={"liala","etra","inites"};

string s;
int n=0;
int m=0,f=0;

void check()
{
	int flag=0;
	for(int i=0;i<3;i++)
	{
		if(s.size()>=ms[i].size() && s.substr(s.size()-ms[i].size())==ms[i])
		{	male[i].push_back(n);m=1;flag=1;	}
	}
	for(int i=0;i<3;i++)
	{
		if(s.size()>=fs[i].size() && s.substr(s.size()-fs[i].size())==fs[i])
		{	fe[i].push_back(n);f=1;flag=1;		}
	}
	if(!flag)
	{
		cout<<"NO";
		exit(0);
	}
}

int32_t main()
{
	IOS;
	while(cin>>s)
	{
		check();
		n++;
	}
	if(m && f)
	{
		cout<<"NO";
		return 0;
	}
	int req[n];
	int cur=0,flag=1;
	for(int i=0;i<3;i++)
	{
		for(auto it:male[i])
		{
			if(it!=cur)
			{
				cout<<"NO";
				return 0;
			}
			else cur++;
		}
	}
	for(int i=0;i<3;i++)
	{
		for(auto it:fe[i])
		{
			if(it!=cur)
			{
				cout<<"NO";
				return 0;
			}
			else cur++;
		}
	}
	if(f && fe[1].size()>1)
		cout<<"NO";
	else if(m &&  male[1].size()>1)
		cout<<"NO";
	else cout<<"YES";
 	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl "\n"

const int N=100005;

vector<int> male[3];
vector<int> fe[3];

string ms[3]={"lios","etr","initis"};
string fs[3]={"liala","etra","inites"};

string s;
int n=0;
int m=0,f=0;

void check()
{
	int flag=0;
	for(int i=0;i<3;i++)
	{
		if(s.size()>=ms[i].size() && s.substr(s.size()-ms[i].size())==ms[i])
		{	male[i].push_back(n);m=1;flag=1;	}
	}
	for(int i=0;i<3;i++)
	{
		if(s.size()>=fs[i].size() && s.substr(s.size()-fs[i].size())==fs[i])
		{	fe[i].push_back(n);f=1;flag=1;		}
	}
	if(!flag)
	{
		cout<<"NO";
		exit(0);
	}
}

int32_t main()
{
	IOS;
	while(cin>>s)
	{
		check();
		n++;
	}
	if(m && f)
	{
		cout<<"NO";
		return 0;
	}
	int req[n];
	int cur=0,flag=1;
	for(int i=0;i<3;i++)
	{
		for(auto it:male[i])
		{
			if(it!=cur)
			{
				cout<<"NO";
				return 0;
			}
			else cur++;
		}
	}
	for(int i=0;i<3;i++)
	{
		for(auto it:fe[i])
		{
			if(it!=cur)
			{
				cout<<"NO";
				return 0;
			}
			else cur++;
		}
	}
	if((f && fe[1].size()>1 )||(m && male[1].size()>1 ))
		cout<<"NO";
	else
		cout<<"YES";
 	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl "\n"

const int N=100005;

vector<int> male[3];
vector<int> fe[3];

string ms[3]={"lios","etr","initis"};
string fs[3]={"liala","etra","inites"};

string s;
int n=0;
int m=0,f=0;

void check()
{
	int flag=0;
	for(int i=0;i<3;i++)
	{
		if(s.size()>=ms[i].size() && s.substr(s.size()-ms[i].size())==ms[i])
		{	male[i].push_back(n);m=1;flag=1;	}
	}
	for(int i=0;i<3;i++)
	{
		if(s.size()>=fs[i].size() && s.substr(s.size()-fs[i].size())==fs[i])
		{	fe[i].push_back(n);f=1;flag=1;		}
	}
	if(!flag)
	{
		cout<<"NO";
		exit(0);
	}
}

int32_t main()
{
	IOS;
	while(cin>>s)
	{
		check();
		n++;
	}
	if(m && f)
	{
		cout<<"NO";
		return 0;
	}
	int req[n];
	int cur=0,flag=1;
	for(int i=0;i<3;i++)
	{
		for(auto it:male[i])
		{
			if(it!=cur)
			{
				cout<<"NO";
				return 0;
			}
			else cur++;
		}
	}
	for(int i=0;i<3;i++)
	{
		for(auto it:fe[i])
		{
			if(it!=cur)
			{
				cout<<"NO";
				return 0;
			}
			else cur++;
		}
	}
	if(n==1)
		cout<<"YES";
	else if(f && fe[1].size()!=1)
		cout<<"NO";
	else if(m && male[1].size()!=1)
		cout<<"NO";
	else cout<<"YES";
 	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl "\n"

const int N=100005;

vector<int> male[3];
vector<int> fe[3];

string ms[3]={"lios","etr","initis"};
string fs[3]={"liala","etra","inites"};

string s;
int n=0;
int m=0,f=0;

void check()
{
	int flag=0;
	for(int i=0;i<3;i++)
	{
		if(s.size()>=ms[i].size() && s.substr(s.size()-ms[i].size())==ms[i])
		{	male[i].push_back(n);m=1;flag=1;	}
	}
	for(int i=0;i<3;i++)
	{
		if(s.size()>=fs[i].size() && s.substr(s.size()-fs[i].size())==fs[i])
		{	fe[i].push_back(n);f=1;flag=1;		}
	}
	if(!flag)
	{
		cout<<"NO";
		exit(0);
	}
}

int32_t main()
{
	IOS;
	while(cin>>s)
	{
		check();
		n++;
	}
	if(m && f)
	{
		cout<<"NO";
		return 0;
	}
	int req[n];
	int cur=0,flag=1;
	for(int i=0;i<3;i++)
	{
		for(auto it:male[i])
		{
			if(it!=cur)
			{
				cout<<"NO";
				return 0;
			}
			else cur++;
		}
	}
	for(int i=0;i<3;i++)
	{
		for(auto it:fe[i])
		{
			if(it!=cur)
			{
				cout<<"NO";
				return 0;
			}
			else cur++;
		}
	}
	if((f && fe[1].size()>1 )||(f && fe[1].size()==0 && fe[2].size() )||(m && male[1].size()>1 )||(m && male[1].size()==0 && male[2].size() ))
		cout<<"NO";
	else
		cout<<"YES";
 	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl "\n"

const int N=100005;

vector<int> male[3];
vector<int> fe[3];

string ms[3]={"lios","etr","initis"};
string fs[3]={"liala","etra","inites"};

string s;
int n=0;
int m=0,f=0;

void check()
{
	int flag=0;
	for(int i=0;i<3;i++)
	{
		if(s.size()>=ms[i].size() && s.substr(s.size()-ms[i].size())==ms[i])
		{	male[i].push_back(n);m=1;flag=1;	}
	}
	for(int i=0;i<3;i++)
	{
		if(s.size()>=fs[i].size() && s.substr(s.size()-fs[i].size())==fs[i])
		{	fe[i].push_back(n);f=1;flag=1;		}
	}
	if(!flag)
	{
		cout<<"NO";
		exit(0);
	}
}

int32_t main()
{
	IOS;
	while(cin>>s)
	{
		check();
		n++;
	}
	if(m && f)
	{
		cout<<"NO";
		return 0;
	}
	int req[n];
	int cur=0,flag=1;
	for(int i=0;i<3;i++)
	{
		for(auto it:male[i])
		{
			if(it!=cur)
			{
				cout<<"NO";
				return 0;
			}
			else cur++;
		}
	}
	for(int i=0;i<3;i++)
	{
		for(auto it:fe[i])
		{
			if(it!=cur)
			{
				cout<<"NO";
				return 0;
			}
			else cur++;
		}
	}
	if((f && fe[1].size()!=1 )||(m && male[1].size()!=1 ))
		cout<<"NO";
	else
		cout<<"YES";
 	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl "\n"

const int N=100005;

vector<int> male[3];
vector<int> fe[3];

string ms[3]={"lios","etr","initis"};
string fs[3]={"liala","etra","inites"};

string s;
int n=0;
int m=0,f=0;

void check()
{
	int flag=0;
	for(int i=0;i<3;i++)
	{
		if(s.size()>=ms[i].size() && s.substr(s.size()-ms[i].size())==ms[i])
		{	male[i].push_back(n);m=1;flag=1;	}
	}
	for(int i=0;i<3;i++)
	{
		if(s.size()>=fs[i].size() && s.substr(s.size()-fs[i].size())==fs[i])
		{	fe[i].push_back(n);f=1;flag=1;		}
	}
	if(!flag)
	{
		cout<<"NO";
		exit(0);
	}
}

int32_t main()
{
	IOS;
	while(cin>>s)
	{
		check();
		n++;
	}
	if(m && f)
	{
		cout<<"NO";
		return 0;
	}
	int req[n];
	int cur=0,flag=1;
	for(int i=0;i<3;i++)
	{
		for(auto it:male[i])
		{
			if(it!=cur)
			{
				cout<<"NO";
				return 0;
			}
			else cur++;
		}
	}
	for(int i=0;i<3;i++)
	{
		for(auto it:fe[i])
		{
			if(it!=cur)
			{
				cout<<"NO";
				return 0;
			}
			else cur++;
		}
	}
	if((f && fe[1].size()>1 ) || (f && fe[0].size() && fe[1].size()!=1))
		cout<<"NO";
	else if((m &&  male[1].size()>1) ||(m && male[0].size() && male[1].size()!=1))
		cout<<"NO";
	else cout<<"YES";
 	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl "\n"

const int N=100005;

vector<int> male[3];
vector<int> fe[3];

string ms[3]={"lios","etr","initis"};
string fs[3]={"liala","etra","inites"};

string s;
int n=0;
int m=0,f=0;

void check()
{
	int flag=0;
	for(int i=0;i<3;i++)
	{
		if(s.size()>=ms[i].size() && s.substr(s.size()-ms[i].size())==ms[i])
		{	male[i].push_back(n);m=1;flag=1;	}
	}
	for(int i=0;i<3;i++)
	{
		if(s.size()>=fs[i].size() && s.substr(s.size()-fs[i].size())==fs[i])
		{	fe[i].push_back(n);f=1;flag=1;		}
	}
	if(!flag)
	{
		cout<<"NO";
		exit(0);
	}
}

int32_t main()
{
	IOS;
	while(cin>>s)
	{
		check();
		n++;
	}
	if(m && f)
	{
		cout<<"NO";
		return 0;
	}
	int req[n];
	int cur=0,flag=1;
	for(int i=0;i<3;i++)
	{
		for(auto it:male[i])
		{
			if(it!=cur)
			{
				cout<<"NO";
				return 0;
			}
			else cur++;
		}
	}
	for(int i=0;i<3;i++)
	{
		for(auto it:fe[i])
		{
			if(it!=cur)
			{
				cout<<"NO";
				return 0;
			}
			else cur++;
		}
	}
	if(n==1)
		cout<<"YES";
	else if(f && fe[1].size()!=1)
		cout<<"NO";
	else if(m && fe[1].size()!=1)
		cout<<"NO";
	else cout<<"YES";
 	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl "\n"

const int N=100005;

vector<int> male[3];
vector<int> fe[3];

string ms[3]={"lios","etr","initis"};
string fs[3]={"liala","etra","inites"};

string s;
int n=0;
int m=0,f=0;

void check()
{
	int flag=0;
	for(int i=0;i<3;i++)
	{
		if(s.size()>=ms[i].size() && s.substr(s.size()-ms[i].size())==ms[i])
		{	male[i].push_back(n);m=1;flag=1;	}
	}
	for(int i=0;i<3;i++)
	{
		if(s.size()>=fs[i].size() && s.substr(s.size()-fs[i].size())==fs[i])
		{	fe[i].push_back(n);f=1;flag=1;		}
	}
	if(!flag)
	{
		cout<<"NO";
		exit(0);
	}
}

int32_t main()
{
	IOS;
	while(cin>>s)
	{
		check();
		n++;
	}
	if(m && f)
	{
		cout<<"NO";
		return 0;
	}
	int req[n];
	int cur=0,flag=1;
	for(int i=0;i<3;i++)
	{
		for(auto it:male[i])
		{
			if(it!=cur)
			{
				cout<<"NO";
				return 0;
			}
			else cur++;
		}
	}
	for(int i=0;i<3;i++)
	{
		for(auto it:fe[i])
		{
			if(it!=cur)
			{
				cout<<"NO";
				return 0;
			}
			else cur++;
		}
	}
	if((f && fe[1].size()>1 ) || (f && fe[0].size() && fe[1].size()!=1 && fe[2].size()))
		cout<<"NO";
	else if((m &&  male[1].size()>1 ) ||(m && male[0].size() && male[1].size()!=1 && male[2].size()))
		cout<<"NO";
	else cout<<"YES";
 	return 0;
}


#include<bits/stdc++.h>
#define int long long
#define NO cout<<"NO"
using namespace std;
string a,b,c,s;
map<string,int> m[3];
int f;
bool sach(string aa)
{
    if(s.size()>=aa.size() && s.substr(s.size()-aa.size(),aa.size())==aa)
        return true;
    return false;
}
void solve(int i)
{
    if(sach(a))
    {
        if(m[i].count(b) || m[i].count(c))
        {
            NO;
            exit(0);
        }
        f=1;
        m[i][a]++;

    }
    if(sach(b))
    {
        if(m[i].count(b) || m[i].count(c))
        {
            NO;
            exit(0);
        }
        f=1;
        m[i][b]++;
    }
    if(sach(c))
    {
        if(m[i].size() && m[i].count(b)==0)
        {
            NO;
            exit(0);
        }
        m[i][c]++;
        f=1;
    }
    if(m[1].size() && m[2].size())
    {
        NO;
        exit(0);
    }
}
int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    while(cin>>s)
    {
        f=0;
        a="lios",b="etr",c="initis";
        solve(1);
        a="liala",b="etra",c="inites";
        solve(2);
        if(f==0)
        {
            cout<<"NO";
            exit(0);
        }
    }
    cout<<"YES";
}


#include<bits/stdc++.h>
#define int long long
#define NO cout<<"NO"
using namespace std;
string a,b,c,s;
map<string,int> m[3];
int f,q;
bool sach(string aa)
{
    if(s.size()>=aa.size() && s.substr(s.size()-aa.size(),aa.size())==aa)
        return true;
    return false;
}
void solve(int i)
{
    if(sach(a))
    {
        if(m[i].count(b) || m[i].count(c))
        {
            NO;
            exit(0);
        }
        f=1;
        m[i][a]++;

    }
    if(sach(b))
    {
        if(m[i].count(b) || m[i].count(c))
        {
            NO;
            exit(0);
        }
        f=1;q=1;
        m[i][b]++;
    }
    if(sach(c))
    {
        if(m[i].size() && m[i].count(b))
        {
            NO;
            exit(0);
        }
        m[i][c]++;
        f=1;
    }
    if(m[1].size() && m[2].size())
    {
        NO;
        exit(0);
    }
}
int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    vector<string> ss;
    while(cin>>s)
    {
        f=0;
        ss.push_back(s);
        a="lios",b="etr",c="initis";
        solve(1);
        a="liala",b="etra",c="inites";
        solve(2);
        if(f==0)
        {
            cout<<"NO";
            exit(0);
        }
    }
    if(ss.size()==1 || q)
    cout<<"YES";
    else
        cout<<"NO";
}


#include<bits/stdc++.h>
#define int long long
#define NO cout<<"NO"
using namespace std;
string a,b,c,s;
map<string,int> m[3];
int f;
bool sach(string aa)
{
    if(s.size()>=aa.size() && s.substr(s.size()-aa.size(),aa.size())==aa)
        return true;
    return false;
}
void solve(int i)
{
    if(sach(a))
    {
        if(m[i].count(b) || m[i].count(c))
        {
            NO;
            exit(0);
        }
        f=1;
        m[i][a]++;

    }
    if(sach(b))
    {
        if(m[i].count(b) || m[i].count(c))
        {
            NO;
            exit(0);
        }
        f=1;
        m[i][b]++;
    }
    if(sach(c))
    {
        if(m[i].count(b)==0)
        {
            NO;
            exit(0);
        }
        m[i][c]++;
        f=1;
    }
    if(m[1].size() && m[2].size())
    {
        NO;
        exit(0);
    }
}
int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    while(cin>>s)
    {
        f=0;
        a="lios",b="etr",c="initis";
        solve(1);
        a="liala",b="etra",c="inites";
        solve(2);
        if(f==0)
        {
            cout<<"NO";
            exit(0);
        }
    }
    cout<<"YES";
}


#include<bits/stdc++.h>
#define int long long
#define NO cout<<"NO"
using namespace std;
string a,b,c,s;
map<string,int> m[3];
int f,q;
bool sach(string aa)
{
    if(s.size()>=aa.size() && s.substr(s.size()-aa.size(),aa.size())==aa)
        return true;
    return false;
}
void solve(int i)
{
    if(sach(a))
    {
        if(m[i].count(b) || m[i].count(c))
        {
            NO;
            exit(0);
        }
        f=1;
        m[i][a]++;

    }
    if(sach(b))
    {
        if(m[i].count(b) || m[i].count(c))
        {
            NO;
            exit(0);
        }
        f=1;q=1;
        m[i][b]++;
    }
    if(sach(c))
    {
        if(m[i].size() && m[i].count(b)==0)
        {
            NO;
            exit(0);
        }
        m[i][c]++;
        f=1;
    }
    if(m[1].size() && m[2].size())
    {
        NO;
        exit(0);
    }
}
int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    vector<string> ss;
    while(cin>>s)
    {
        f=0;
        ss.push_back(s);
        a="lios",b="etr",c="initis";
        solve(1);
        a="liala",b="etra",c="inites";
        solve(2);
        if(f==0)
        {
            cout<<"NO";
            exit(0);
        }
    }
    if(ss.size()==1 || q)
    cout<<"YES";
    else
        cout<<"NO";
}


#include<bits/stdc++.h>
#define int long long
#define NO cout<<"NO"
using namespace std;
string a,b,c,s;
map<string,int> m[3];
int f;
bool sach(string aa)
{
    if(s.size()>=aa.size() && s.substr(s.size()-aa.size(),aa.size())==aa)
        return true;
    return false;
}
void solve(int i)
{
    if(sach(a))
    {
        if(m[i].count(b) || m[i].count(c))
        {
            NO;
            exit(0);
        }
        f=1;
        m[i][a]++;

    }
    if(sach(b))
    {
        if(m[i].count(b) || m[i].count(c))
        {
            NO;
            exit(0);
        }
        f=1;
        m[i][b]++;
    }
    if(sach(c))
    {
        if(m[i].count(b)==0)
        {
            NO;
            exit(0);
        }
        m[i][c]++;
        f=1;
    }
    if(m[1].size() && m[2].size())
    {
        NO;
        exit(0);
    }
}
int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    while(cin>>s)
    {
        int aa=m[1].size()+m[2].size();
        a="lios",b="etr",c="initis";
        solve(1);
        a="liala",b="etra",c="inites";
        solve(2);
        if(s.size()<3 || !f)
        {
            cout<<"NO";
            exit(0);
        }
    }
    cout<<"YES";
}


#include<bits/stdc++.h>
#define int long long
#define NO cout<<"NO"
using namespace std;
string a,b,c,s;
map<string,int> m[3];
int f;
bool sach(string aa)
{
    if(s.size()>=aa.size() && s.substr(s.size()-aa.size(),aa.size())==aa)
        return true;
    return false;
}
void solve(int i)
{
    if(sach(a))
    {
        if(m[i].count(b) || m[i].count(c))
        {
            NO;
            exit(0);
        }
        f=1;
        m[i][a]++;

    }
    if(sach(b))
    {
        if(m[i].count(b) || m[i].count(c))
        {
            NO;
            exit(0);
        }
        f=1;
        m[i][b]++;
    }
    if(sach(c))
    {
        if(m[i].size() && m[i].count(b))
        {
            NO;
            exit(0);
        }
        m[i][c]++;
        f=1;
    }
    if(m[1].size() && m[2].size())
    {
        NO;
        exit(0);
    }
}
int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    while(cin>>s)
    {
        f=0;
        a="lios",b="etr",c="initis";
        solve(1);
        a="liala",b="etra",c="inites";
        solve(2);
        if(f==0)
        {
            cout<<"NO";
            exit(0);
        }
    }
    cout<<"YES";
}


#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repd(i,a,b) for(int i=a;i>b;i--)
#define vi vector<int>
#define pii pair<int,int>
#define mii map<int,int>
#define SET(A,VAL) memset(A, VAL, sizeof(A))
#define ff first
#define ss second
#define pb push_back
const int MAX = 1e6+8;
const int sz = 1e5+5;
void f_io(){
    IOS;
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
    #endif
}
bool flag,noun,adj,verb;
bool gender(string s)
{
    if(s[s.size()-1]=='s' && s[s.size()-2]=='o')
        return 0;
    if(s[s.size()-1]=='r' && s[s.size()-2]=='t')
        return 0;
    if(s[s.size()-1]=='s' && s[s.size()-2]=='i')
        return 0;

    if(s[s.size()-1]=='a' && s[s.size()-2]=='l')
        return 1;
    if(s[s.size()-1]=='a' && s[s.size()-2]=='r')
        return 1;
    if(s[s.size()-1]=='s' && s[s.size()-2]=='e')
        return 1;
    return 0;
}

bool valid(string s){
    bool check=0;
    int j;
    string a="liala";
    j=s.size();
    if(j>=a.size())
        for(int i=a.size()-1; i>=0; i--){
            if(a[i]!=s[--j])
                break;
            if(i==0)
                return 1;
        }
    a="lios";
    j=s.size();
    if(j>=a.size())
        for(int i=a.size()-1; i>=0; i--){
            if(a[i]!=s[--j])
                break;
            if(i==0)
                return 1;
        }
    a="etr";
    j=s.size();
    if(j>=a.size())
        for(int i=a.size()-1; i>=0; i--){
            if(a[i]!=s[--j])
                break;
            if(i==0)
                return 1;
        }
    a="etra";
    j=s.size();
    if(j>=a.size())
        for(int i=a.size()-1; i>=0; i--){
            if(a[i]!=s[--j])
                break;
            if(i==0)
                return 1;
        }
    a="initis";
    j=s.size();
    if(j>=a.size())
        for(int i=a.size()-1; i>=0; i--){
            if(a[i]!=s[--j])
                break;
            if(i==0)
                return 1;
        }
    a="inites";
    j=s.size();
    if(j>=a.size())
        for(int i=a.size()-1; i>=0; i--){
            if(a[i]!=s[--j])
                break;
            if(i==0)
                return 1;
        }
    return 0;
}
bool isadj(string s){
    if(s[s.size()-1]=='s' && s[s.size()-2]=='o')
        return true;
    if(s[s.size()-1]=='a' && s[s.size()-2]=='l')
        return true;
    return false;
}
bool isn(string s){
    if(s[s.size()-1]=='r' && s[s.size()-2]=='t')
        return true;
    if(s[s.size()-1]=='a' && s[s.size()-2]=='r')
        return true;
    return false;

}
bool isv(string s){
    if(s[s.size()-1]=='s' && s[s.size()-2]=='i')
        return true;
    if(s[s.size()-1]=='s' && s[s.size()-2]=='e')
        return true;
    return false;
}
int32_t main(){
    f_io();
    int t = 1;
    //cin>>t;
    while(t--){
        string str,str1;
        std::vector<string> v;
        getline(cin,str);
        stringstream ss(str);
        while(getline(ss,str1,' ')) v.pb(str1);
        bool g = gender(v[0]);
        rep(i,0,v.size()){
            string s = v[i];
            if(!valid(s) || gender(s) != g){
                flag = 1;
                break;
            }
            g = gender(s);
            if(isadj(s) && !noun && !verb){
                adj = 1;
                continue;
            }
            else if(isadj(s) && (noun||verb)){
                flag = 1;
                break;
            }
            else if(isn(s) && (noun||verb)){
                flag = 1;
                break;
            }
            else if(isn(s) && !verb){
                noun = 1;
                continue;
            }
            else if(isv(s) && !noun){
                flag = 1;
                break;
            }
            else if(isv(s) && noun){
                verb = 1;
                continue;
            }
        }
        if(flag) cout<<"NO"<<endl;
        else cout<<"YES"<<endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repd(i,a,b) for(int i=a;i>b;i--)
#define vi vector<int>
#define pii pair<int,int>
#define mii map<int,int>
#define SET(A,VAL) memset(A, VAL, sizeof(A))
#define ff first
#define ss second
#define pb push_back
const int MAX = 1e6+8;
const int sz = 1e5+5;
void f_io(){
    IOS;
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
    #endif
}
bool flag,noun,adj,verb;
bool valid(string s){
    bool check=0;
    int j;
    string a="liala";
    j=s.size();
    if(j>=a.size())
        for(int i=a.size()-1; i>=0; i--){
            if(a[i]!=s[--j])
                break;
            if(i==0)
                return 1;
        }
    a="lios";
    j=s.size();
    if(j>=a.size())
        for(int i=a.size()-1; i>=0; i--){
            if(a[i]!=s[--j])
                break;
            if(i==0)
                return 1;
        }
    a="etr";
    j=s.size();
    if(j>=a.size())
        for(int i=a.size()-1; i>=0; i--){
            if(a[i]!=s[--j])
                break;
            if(i==0)
                return 1;
        }
    a="etra";
    j=s.size();
    if(j>=a.size())
        for(int i=a.size()-1; i>=0; i--){
            if(a[i]!=s[--j])
                break;
            if(i==0)
                return 1;
        }
    a="initis";
    j=s.size();
    if(j>=a.size())
        for(int i=a.size()-1; i>=0; i--){
            if(a[i]!=s[--j])
                break;
            if(i==0)
                return 1;
        }
    a="inites";
    j=s.size();
    if(j>=a.size())
        for(int i=a.size()-1; i>=0; i--){
            if(a[i]!=s[--j])
                break;
            if(i==0)
                return 1;
        }
    return 0;
}
bool isadj(string s){
    if(s[s.size()-1]=='s' && s[s.size()-2]=='o')
        return true;
    if(s[s.size()-1]=='a' && s[s.size()-2]=='l')
        return true;
    return false;
}
bool isn(string s){
    if(s[s.size()-1]=='r' && s[s.size()-2]=='t')
        return true;
    if(s[s.size()-1]=='a' && s[s.size()-2]=='r')
        return true;
    return false;

}
bool isv(string s){
    if(s[s.size()-1]=='s' && s[s.size()-2]=='i')
        return true;
    if(s[s.size()-1]=='s' && s[s.size()-2]=='e')
        return true;
    return false;
}
int32_t main(){
    f_io();
    int t = 1;
    //cin>>t;
    while(t--){
        string str,str1;
        std::vector<string> v;
        getline(cin,str);
        stringstream ss(str);
        while(getline(ss,str1,' ')) v.pb(str1);
        rep(i,0,v.size()){
            string s = v[i];
            if(!valid(s)){
                flag = 1;
                break;
            }
            if(isadj(s) && !noun && !verb){
                adj = 1;
                continue;
            }
            else if(isadj(s) && (noun||verb)){
                flag = 1;
                break;
            }
            else if(isn(s) && (noun||verb)){
                flag = 1;
                break;
            }
            else if(isn(s) && !verb){
                noun = 1;
                continue;
            }
            else if(isv(s) && !noun){
                flag = 1;
                break;
            }
            else if(isv(s) && noun){
                verb = 1;
                continue;
            }
        }
        if(flag) cout<<"NO"<<endl;
        else cout<<"YES"<<endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repd(i,a,b) for(int i=a;i>b;i--)
#define vi vector<int>
#define pii pair<int,int>
#define mii map<int,int>
#define SET(A,VAL) memset(A, VAL, sizeof(A))
#define ff first
#define ss second
#define pb push_back
const int MAX = 1e6+8;
const int sz = 1e5+5;
void f_io(){
    IOS;
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
    #endif
}

bool gender(string s)
{
    if(s[s.size()-1]=='s' && s[s.size()-2]=='o')
        return 0;
    if(s[s.size()-1]=='r' && s[s.size()-2]=='t')
        return 0;
    if(s[s.size()-1]=='s' && s[s.size()-2]=='i')
        return 0;

    if(s[s.size()-1]=='a' && s[s.size()-2]=='l')
        return 1;
    if(s[s.size()-1]=='a' && s[s.size()-2]=='r')
        return 1;
    if(s[s.size()-1]=='s' && s[s.size()-2]=='e')
        return 1;
    return 0;
}
int type(string s)
{
    if(s[s.size()-1]=='s' && s[s.size()-2]=='o')
        return 1;
    if(s[s.size()-1]=='a' && s[s.size()-2]=='l')
        return 1;

    if(s[s.size()-1]=='r' && s[s.size()-2]=='t')
        return 2;
    if(s[s.size()-1]=='a' && s[s.size()-2]=='r')
        return 2;

    if(s[s.size()-1]=='s' && s[s.size()-2]=='i')
        return 3;
    if(s[s.size()-1]=='s' && s[s.size()-2]=='e')
        return 3;
}

bool valid(string s){
    bool check=0;
    int j;
    string a="liala";
    j=s.size();
    if(j>=a.size())
        for(int i=a.size()-1; i>=0; i--){
            if(a[i]!=s[--j])
                break;
            if(i==0)
                return 1;
        }
        a="lios";
        j=s.size();
        if(j>=a.size())
            for(int i=a.size()-1; i>=0; i--){
                if(a[i]!=s[--j])
                    break;
                if(i==0)
                    return 1;
            }
            a="etr";
            j=s.size();
            if(j>=a.size())
                for(int i=a.size()-1; i>=0; i--){
                    if(a[i]!=s[--j])
                        break;
                    if(i==0)
                        return 1;
                }
                a="etra";
                j=s.size();
                if(j>=a.size())
                    for(int i=a.size()-1; i>=0; i--){
                        if(a[i]!=s[--j])
                            break;
                        if(i==0)
                            return 1;
                    }
                    a="initis";
                    j=s.size();
                    if(j>=a.size())
                        for(int i=a.size()-1; i>=0; i--){
                            if(a[i]!=s[--j])
                                break;
                            if(i==0)
                                return 1;
                        }
                        a="inites";
                        j=s.size();
                        if(j>=a.size())
                            for(int i=a.size()-1; i>=0; i--){
                                if(a[i]!=s[--j])
                                    break;
                                if(i==0)
                                    return 1;
                            }
                            return 0;
                        }
                        bool isadj(string s){
                            if(s[s.size()-1]=='s' && s[s.size()-2]=='o')
                                return true;
                            if(s[s.size()-1]=='a' && s[s.size()-2]=='l')
                                return true;
                            return false;
                        }
                        bool isn(string s){
                            if(s[s.size()-1]=='r' && s[s.size()-2]=='t')
                                return true;
                            if(s[s.size()-1]=='a' && s[s.size()-2]=='r')
                                return true;
                            return false;

                        }
                        bool isv(string s){
                            if(s[s.size()-1]=='s' && s[s.size()-2]=='i')
                                return true;
                            if(s[s.size()-1]=='s' && s[s.size()-2]=='e')
                                return true;
                            return false;
                        }
                        int32_t main(){
                            f_io();
                            int t = 1;
                            while(t--){
                                string str,str1;
                                std::vector<string> arr;
                                getline(cin,str);
                                stringstream ss(str);
                                while(getline(ss,str1,' ')) arr.pb(str1);
                                bool gen=gender(arr[0]);
                                bool check1=0,check2=0,check3=0;
                                for(int i=0; i<arr.size(); i++)
                                {
                                    if(!valid(arr[i]))
                                    {
                                        cout<<"NO"<<endl;
                                        return 0;
                                    }
                                    if(gen!=gender(arr[i]))
                                    {
                                        cout<<"NO"<<endl;
                                        return 0;
                                    }
                                    if(type(arr[i])==2 && check2)
                                    {
                                        cout<<"NO"<<endl;
                                        return 0;
                                    }
                                    if(type(arr[i])==3 && !check2 && check1)
                                    {
                                        cout<<"NO"<<endl;
                                        return 0;
                                    }
                                    if(type(arr[i])==1 && check2 && check3)
                                    {
                                        cout<<"NO"<<endl;
                                        return 0;
                                    }
                                    if(type(arr[i])==2 && check3)
                                    {
                                        cout<<"NO"<<endl;
                                        return 0;
                                    }
                                    if(type(arr[i])==1 && check2)
                                    {
                                        cout<<"NO"<<endl;
                                        return 0;
                                    }
                                    if(type(arr[i])==1 && check3)
                                    {
                                        cout<<"NO"<<endl;
                                        return 0;
                                    }
                                    if(type(arr[i])==2)
                                        check2=1;
                                    if(type(arr[i])==1)
                                        check1=1;
                                    if(type(arr[i])==3)
                                        check3=1;
                                }
                                if(check2 || (arr.size()==1))
                                    cout<<"YES"<<endl;
                                else
                                    cout<<"NO"<<endl;
                            }
                        }


#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cctype>
#include <cstdlib>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <queue>
#include <stack>
#include <cmath>
using namespace std;
const int INF = 0x3f3f3f3f;
#define LL long long
char s[100010];
char word[100010];
int num[100010];
int change()
{
	int len=strlen(word);
	if(len<3)
	return 0;
	if(strcmp(word+len-4,"lios")==0)
		return 1;
	if(strcmp(word+len-5,"liala")==0)
		return -1;
	if(strcmp(word+len-3,"etr")==0)
		return 2;
    if(strcmp(word+len-4,"etra")==0)
		return -2;
	if(strcmp(word+len-6,"initis")==0)
		return 3;
	if(strcmp(word+len-6,"inites")==0)
		return -3;
	return 0;

}
int main()
{
	while(gets(s))
	{
		int tp=0,flag=1,i,len=strlen(s),t,p=0,cnt=0;
		for(i=0;i<=len;i++)
		{
			if(s[i]!=' '&&s[i]!='\0')
			{
				word[p++]=s[i];
			}
			else
			{
				word[p]='\0';
				t=change();
				cnt++;
				if(t!=0)
				num[tp++]=t;
				else
				{
					flag=0;
					break;
				}
			}
		}
		//printf("%d\n",cnt);
		if(cnt==1&&flag==1)
		{
			puts("YES");
			continue;
		}
		if(flag==0)
		{
			puts("NO");
			continue;
		}
		cnt=0;
		for(i=0;i<tp;i++)
			if(abs(num[i])==2)
			cnt++;
		if(cnt!=1)
		{
			puts("NO");
			continue;
		}
		flag=1;
		if(num[0]<0)
		{
			for(i=1;i<tp;i++)
				if(num[i]>0)
				{
					flag=0;
				    break;
				}
		}
		else
		{
			for(i=1;i<tp;i++)
				if(num[i]<0)
				{
					flag=0;
				    break;
				}
		}
		if(flag==0)
		{
			puts("NO");
			continue;
		}
		flag=1;
		for(i=1;i<tp;i++)
		{
			if(abs(num[i])<abs(num[i-1]))
			{
				flag=0;
				break;
			}
		}
		if(flag)
			puts("YES");
		else
			puts("NO");
	}
	return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <map>
#include <math.h>
using namespace std;

#define FOR(i,n)    for(int (i)=0;(i)<(n);(i)++)

int main()
{
    string s,s1;
    vector<int> chast;
    vector<bool> rod;
    getline(cin,s);
    istringstream ss(s);
    bool st=true;
    while(!ss.eof())
    {
        ss >> s1;
        if(s1.length()>=4 && s1.substr(s1.length()-4,4)=="lios")
        {
            chast.push_back(0);
            rod.push_back(true);
            continue;
        }
        if(s1.length()>=5 && s1.substr(s1.length()-5,5)=="liala")
        {
            chast.push_back(0);
            rod.push_back(false);
            continue;
        }

        if(s1.length()>=3 && s1.substr(s1.length()-3,3)=="etr")
        {
            chast.push_back(1);
            rod.push_back(true);
            continue;
        }
        if(s1.length()>=4 && s1.substr(s1.length()-4,4)=="etra")
        {
            chast.push_back(1);
            rod.push_back(false);
            continue;
        }

        if(s1.length()>=6 && s1.substr(s1.length()-6,6)=="initis")
        {
            chast.push_back(2);
            rod.push_back(true);
            continue;
        }
        if(s1.length()>=6 && s1.substr(s1.length()-6,6)=="inites")
        {
            chast.push_back(2);
            rod.push_back(false);
            continue;
        }
        st=false;
    }
    for(int i=1;i<rod.size();i++)
        if(rod[i]!=rod[i-1])
        {
            st=false;
            break;
        }
    if(chast.size()>1)
    {
        int j=0;
        for(;j<chast.size();j++)
            if(chast[j]!=0)
                break;
        if(j>=chast.size() || chast[j]!=1)
            st=false;
        else
        {
            j++;
            for(;j<chast.size();j++)
                if(chast[j]!=2)
                    break;
            if(j<chast.size())
                st=false;
        }
    }
    cout << (st ? "YES" : "NO");
    int n;
    cin >> n;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string.h>
#include <string>
#include <vector>
#include <map>
#include <cmath>
#include <set>
#include <algorithm>
#include <queue>
#include <utility>
#define debug1(x) cout << #x" = " << x << endl;
#define debug2(x, y) cout << #x" = " << x << " " << #y" = " << y << endl;
#define debug3(x, y, z) cout << #x" = " << x << " " << #y" = " << y << " " << #z" = " << z << endl;
#define debug4(x, y, z, w) cout << #x" = " << x << " " << #y" = " << y << " " << #z" = " << z << " " << #w" = " << w << endl;
using namespace std;

void init();
void york();

/**
Masculine adjectives end with -lios, and feminine adjectives end with -liala.
Masculine nouns end with -etr, and feminime nouns end with -etra.
Masculine verbs end with -initis, and feminime verbs end with -inites.
*/
map<string, int> t;
vector<int> sen;
void init()
{
  t["lios"] = 1;
  t["liala"] = -1;
  t["etr"] = 2;
  t["etra"] = -2;
  t["initis"] = 3;
  t["inites"] = -3;

  string word;
  set<int> sign;
  map<int, int> tcnt;
  while (cin >> word)
  {
    //if (word == "#") break;
    bool found = false;
    for (map<string, int>::iterator itr = t.begin(); itr != t.end(); ++itr)
    {
      const string & pat = itr->first;
      if (word.length() >= pat.length() && word.substr(word.length() - pat.length()) == pat)
      {
        sen.push_back(abs(itr->second));
        found = true;
        sign.insert(itr->second / abs(itr->second));
        tcnt[abs(itr->second)]++;
        break;
      }
    }

    if (!found)
    {
      cout << "NO" << endl;
      return;
    }
  }

  if (sign.size() > 1)
  {
    cout << "NO" << endl;
    return;
  }

  if (sen.size() == 1)
  {
    cout << "YES" << endl;
    return;
  }

  if (tcnt.find(2) == tcnt.end() || tcnt[2] != 1)
  {
    cout << "NO" << endl;
    return;
  }

  for (int i = 0; i < sen.size() - 1; ++i)
    if (sen[i] > sen[i + 1])
    {
      cout << "NO" << endl;
      return;
    }

  cout << "YES" << endl;
}

void york()
{
}

int main()
{
  init();
  york();
  return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string.h>
#include <string>
#include <vector>
#include <map>
#include <cmath>
#include <set>
#include <algorithm>
#include <queue>
#include <utility>
#define debug1(x) cout << #x" = " << x << endl;
#define debug2(x, y) cout << #x" = " << x << " " << #y" = " << y << endl;
#define debug3(x, y, z) cout << #x" = " << x << " " << #y" = " << y << " " << #z" = " << z << endl;
#define debug4(x, y, z, w) cout << #x" = " << x << " " << #y" = " << y << " " << #z" = " << z << " " << #w" = " << w << endl;
using namespace std;

void init();
void york();

/**
Masculine adjectives end with -lios, and feminine adjectives end with -liala.
Masculine nouns end with -etr, and feminime nouns end with -etra.
Masculine verbs end with -initis, and feminime verbs end with -inites.
*/
map<string, int> t;
vector<int> sen;
void init()
{
  t["lios"] = 1;
  t["liala"] = -1;
  t["etr"] = 2;
  t["etra"] = -2;
  t["initis"] = 3;
  t["inites"] = -3;

  string word;
  set<int> sign;
  set<int> tcnt;
  while (cin >> word)
  {
    //if (word == "#") break;
    bool found = false;
    for (map<string, int>::iterator itr = t.begin(); itr != t.end(); ++itr)
    {
      const string & pat = itr->first;
      if (word.length() >= pat.length() && word.substr(word.length() - pat.length()) == pat)
      {
        sen.push_back(abs(itr->second));
        found = true;
        sign.insert(itr->second / abs(itr->second));
        tcnt.insert(abs(itr->second));
        break;
      }
    }

    if (!found)
    {
      cout << "NO" << endl;
      return;
    }
  }

  if (sign.size() > 1)
  {
    cout << "NO" << endl;
    return;
  }

  if (sen.size() == 1)
  {
    cout << "YES" << endl;
    return;
  }

  if (tcnt.find(2) == tcnt.end())
  {
    cout << "NO" << endl;
    return;
  }

  for (int i = 0; i < sen.size() - 1; ++i)
    if (sen[i] > sen[i + 1])
    {
      cout << "NO" << endl;
      return;
    }

  cout << "YES" << endl;
}

void york()
{
}

int main()
{
  init();
  york();
  return 0;
}


#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <stdio.h>
#include <algorithm>
#include <functional>
#include <cstdlib>
using namespace std;

int main(){
	vector <string> Petya;
	string buf;
	while(cin >> buf){
		Petya.push_back(buf);
	}
	if(Petya.size()==1){
		if((Petya[0].size()>=4 && Petya[0].rfind("lios")==Petya[0].size()-4)
		|| (Petya[0].size()>=3 && Petya[0].rfind("etr")==Petya[0].size()-3)
		|| (Petya[0].size()>=5 && Petya[0].rfind("liala")==Petya[0].size()-5)
		|| (Petya[0].size()>=4 && Petya[0].rfind("etra")==Petya[0].size()-4)
		|| (Petya[0].size()>=6 && Petya[0].rfind("initis")==Petya[0].size()-6)
		|| (Petya[0].size()>=6 && Petya[0].rfind("inites")==Petya[0].size()-6)){
			cout << "YES" << endl;
			return 0;
		}else{
			cout << "NO" << endl;
			return 0;
		}
	}
	int i = 0, flag = 1;
	bool cnt2 = false;
	bool sex;	//true = male, false = female
	int noun = 0;
	if(Petya[0].rfind("lios")==Petya[0].size()-4
		|| Petya[0].rfind("etr")==Petya[0].size()-3){
			sex = true;
	}else if(Petya[0].rfind("liala")==Petya[0].size()-5
		|| Petya[0].rfind("etra")==Petya[0].size()-4){
			sex = false;
	}else{
		cout << "NO" << endl;
		return 0;
	}
	if(sex){	//male
		while(i<Petya.size()){
			if(flag == 1){
				if(Petya[i].size()>=4 && Petya[i].rfind("lios")==Petya[i].size()-4){
						i++;
				}else{
					flag = 2;
				}
			}else if(flag == 2){
				if(Petya[i].size()>=3 && Petya[i].rfind("etr")==Petya[i].size()-3){
						i++;
						cnt2 = true;
						noun++;
				}else{
					if(!cnt2){
						cout << "NO" << endl;
						return 0;
					}else{
						flag = 3;
					}
				}
			}else if(flag == 3){
				if(Petya[i].size()>=6 && Petya[i].rfind("initis")==Petya[i].size()-6){
						i++;
				}else{
					cout << "NO" << endl;
					return 0;
				}
			}
		}
	}else{
		while(i<Petya.size()){
			if(flag == 1){
				if(Petya[i].size()>=5 && Petya[i].rfind("liala")==Petya[i].size()-5){
						i++;
				}else{
					flag = 2;
				}
			}else if(flag == 2){
				if(Petya[i].size()>=4 && Petya[i].rfind("etra")==Petya[i].size()-4){
						i++;
						cnt2 = true;
						noun++;
				}else{
					if(!cnt2){
						cout << "NO" << endl;
						return 0;
					}else{
						flag = 3;
					}
				}
			}else if(flag == 3){
				if(Petya[i].size()>=6 && Petya[i].rfind("inites")==Petya[i].size()-6){
						i++;
				}else{
					cout << "NO" << endl;
					return 0;
				}
			}
		}
	}
	if(noun==1) cout << "YES" << endl;
	else cout << "NO" << endl;
}


#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>

using namespace std;

const int MAXN = 1e5+1;

int n;
char word[MAXN];
bool endswith(const char *s) {
	int m = strlen(s);
	if(m > n) return false;
	for(int i = 0; i < m; i++) if(word[n-i-1] != s[m-i-1]) return false;
	return true;
}

void no() {
	printf("NO\n");
	exit(0);
}

int getGender() {
	if(endswith("lios") || endswith("etr") || endswith ("initis")) return 0;
	if(endswith("liala") || endswith("etra") || endswith ("inites")) return 1;
	no();
}

int getType() {
	if(endswith("lios") || endswith("liala")) return 0;
	if(endswith("etr") || endswith("etra")) return 1;
	if(endswith("initis") || endswith("inites")) return 2;
	no();
}

int main() {

	int gender = -1;
	int phase = 0;

	int count[3];
	count[0] = count[1] = count[2] = 0;

	while(scanf("%s", word) != -1) {
		n = strlen(word);
		if(gender == -1) gender = getGender();
		else if(gender != getGender()) no();
		int part = getType();
		if(part < phase) no();
		phase = part;
		count[phase]++;
	}

	if((count[1] != 1) && (count[0] + count[1] + count[2] > 1)) no();
	printf("YES\n");
}


#define _CRT_SECURE_NO_WARNINGS
#pragma comment (linker, "/STACK:16777216")
#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <queue>
#include <list>
#include <stack>
#include <string>
#include <fstream>
#include <math.h>
#include <limits>
#include <set>
#include <map>
#include <sstream>
#include <stdio.h>
#include <time.h>
#include <memory.h>
#include <cassert>
#include <complex>
#ifdef MY_JUDGE
#include <windows.h>
#endif
using namespace std;

///////////////// macros and typedefs ///////////////////
#define rep(i, n) for (int i = 0, _n = (n); i < _n; ++i)
#define repd(i, n) for (int i = (n)-1; i >= 0; --i)
#define _fill(a, x) memset((a), (x), sizeof((a)))
#define DEB(k) cerr<<"debug: "#k<<"="<<k<<endl;
#define all(c) (c).begin(), (c).end()
#define mp(a, b) make_pair(a, b)
#define l(c) (int)((c).size())
#define sqr(a) ((a)*(a))
#define inf 0x7f7f7f7f
#define pb push_back
#define ppb pop_back
#define x first
#define y second
typedef long long ll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef pair<int,int> pi;

vector<string> S;

bool ends(const string& s, const string& t) {
    if (l(s) < l(t)) return false;
    int k = l(s)-1;
    repd(i, l(t)) {
        if (s[k] != t[i]) return false;
        k--;
    }
    return true;
}

bool pri(const string& s) { return ends(s, "lios") || ends(s, "liala"); }
bool su(const string& s) { return ends(s, "etr") || ends(s, "etra"); }
bool gla(const string& s) { return ends(s, "initis") || ends(s, "inites"); }
bool word(const string& s) { return pri(s) || su(s) || gla(s); }
bool man(const string& s) { return ends(s, "lios") || ends(s, "etr") || ends(s, "initis"); }

void solution()
{
    string t;
    while (cin >> t)
        S.pb(t);
    bool Man = false, wom = false;
    rep(i, l(S)) {
        if (!word(S[i]))
            { puts("NO"); return; }
        if (man(S[i])) Man = true;
        else wom = true;
    }
    if (Man && wom)
        { puts("NO"); return; }
    if (l(S) == 1)
        { puts("YES"); return; }
    int k = -1;
    rep(i, l(S))
        if (su(S[i])) {
            k = i;
            break;
        }
    if (k == -1)
        { puts("NO"); return; }
    for (int i = 0; i < k; i++)
        if (!pri(S[i]))
            { puts("NO"); return; }
    for (int i = k+1; i < l(S); i++)
        if (!gla(S[i]))
            { puts("NO"); return; }
    puts("YES");
}

int main()
{
#ifdef MY_JUDGE
   freopen("my.in", "rt", stdin);
   //freopen("my.out", "wt", stdout);
   int start = GetTickCount();
#endif
   solution();
#ifdef MY_JUDGE
   int finish = GetTickCount();
   cerr << "Time: " << finish - start << endl;
#endif
   return 0;
}


#define _CRT_SECURE_NO_DEPRECATE

#include <iostream>
#include <cstdio>
#include <memory>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <list>
#include <stack>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <ctime>
#include <utility>

#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define LL long long
#define VI vector<int>
#define X first
#define Y second
#define sz(_v) ((int)_v.size())
#define all(_v) (_v).begin(),(_v).end()
#define FOR(i,a,b) for (int i(a); i<=(b); i++)
#define rep(i,a) FOR(i,1,a)
#define rept(i,a) FOR(i,0,a-1)
#define x1 X1
#define y1 Y1
#define sqr(a) ((a)*(a))
#define INF 2000000000

using namespace std;

int gender,type;

bool detect(string& s)
{
    if (s.length()<3) return false;
    string temp;
    rept(i,3) temp+=s[s.length()-1-i];
    if (temp=="rte")
    {
        gender=1;
        type=2;
        return true;
    }
    if (s.length()<4) return false;
    temp+=s[s.length()-4];
    if (temp=="arte")
    {
        gender=2;
        type=2;
        return true;
    }
    if (temp=="soil")
    {
        gender=1;
        type=1;
        return true;
    }
    if (s.length()<5) return false;
    temp+=s[s.length()-5];
    if (temp=="alail")
    {
        gender=2;
        type=1;
        return true;
    }
    if (s.length()<6) return false;
    temp+=s[s.length()-6];
    if (temp=="sitini")
    {
        gender=1;
        type=3;
        return true;
    }
    if (temp=="setini")
    {
        gender=2;
        type=3;
        return true;
    }
    return false;
}

int main()
{
    int genders[2]={0,0};
    int stage=0;
    string s;
    getline(cin,s);
    string temp;
    bool ok=true;
    if (s.find(" ")==string::npos && detect(s))
    {
        printf("YES\n");
        return 0;
    }
    rept(i,s.length()+1)
    {
        if (i==s.length() || s[i]==' ')
        {
            if (!detect(temp)) ok=false;
            else
            {
                genders[gender-1]++;
                if (stage==0 && type==1);
                else if (stage==0 && type==2) stage=1;
                else if (stage==1 && type==3) stage=2;
                else if (stage==2 && type==3);
                else ok=false;
            }
            temp.clear();
        }
        else temp+=s[i];
    }
    if (stage!=0 && ok && genders[0]*genders[1]==0) printf("YES\n");
    else printf("NO\n");
    return 0;
}


#define _CRT_SECURE_NO_DEPRECATE

#include <iostream>
#include <cstdio>
#include <memory>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <list>
#include <stack>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <ctime>
#include <utility>

#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define LL long long
#define VI vector<int>
#define X first
#define Y second
#define sz(_v) ((int)_v.size())
#define all(_v) (_v).begin(),(_v).end()
#define FOR(i,a,b) for (int i(a); i<=(b); i++)
#define rep(i,a) FOR(i,1,a)
#define rept(i,a) FOR(i,0,a-1)
#define x1 X1
#define y1 Y1
#define sqr(a) ((a)*(a))
#define INF 2000000000

using namespace std;

int gender,type;

bool detect(string& s)
{
    if (s.length()<3) return false;
    string temp;
    rept(i,3) temp+=s[s.length()-1-i];
    if (temp=="rte")
    {
        gender=1;
        type=2;
        return true;
    }
    if (s.length()<4) return false;
    temp+=s[s.length()-4];
    if (temp=="arte")
    {
        gender=2;
        type=2;
        return true;
    }
    if (temp=="soil")
    {
        gender=1;
        type=1;
        return true;
    }
    if (s.length()<5) return false;
    temp+=s[s.length()-5];
    if (temp=="alail")
    {
        gender=2;
        type=1;
        return true;
    }
    if (s.length()<6) return false;
    temp+=s[s.length()-6];
    if (temp=="sitini")
    {
        gender=1;
        type=3;
        return true;
    }
    if (temp=="setini")
    {
        gender=2;
        type=3;
        return true;
    }
    return false;
}

int main()
{
    int genders[2]={0,0};
    int stage=0;
    string s;
    getline(cin,s);
    string temp;
    bool ok=true;
    rept(i,s.length()+1)
    {
        if (i==s.length() || s[i]==' ')
        {
            if (!detect(temp)) ok=false;
            else
            {
                genders[gender-1]++;
                if (stage==0 && type==1);
                else if (stage==0 && type==2) stage=1;
                else if (stage==1 && type==3) stage=2;
                else if (stage==2 && type==3);
                else ok=false;
            }
            temp.clear();
        }
        else temp+=s[i];
    }
    if (ok && genders[0]*genders[1]==0) printf("YES\n");
    else printf("NO\n");
    return 0;
}


#define _CRT_SECURE_NO_DEPRECATE

#include <iostream>
#include <cstdio>
#include <memory>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <list>
#include <stack>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <ctime>
#include <utility>

#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define LL long long
#define VI vector<int>
#define X first
#define Y second
#define sz(_v) ((int)_v.size())
#define all(_v) (_v).begin(),(_v).end()
#define FOR(i,a,b) for (int i(a); i<=(b); i++)
#define rep(i,a) FOR(i,1,a)
#define rept(i,a) FOR(i,0,a-1)
#define x1 X1
#define y1 Y1
#define sqr(a) ((a)*(a))
#define INF 2000000000

using namespace std;

int gender,type;

bool detect(string& s)
{
    if (s.length()<3) return false;
    string temp;
    rept(i,3) temp+=s[s.length()-1-i];
    if (temp=="rte")
    {
        gender=1;
        type=2;
        return true;
    }
    if (s.length()<4) return false;
    temp+=s[s.length()-4];
    if (temp=="arte")
    {
        gender=2;
        type=2;
        return true;
    }
    if (temp=="soil")
    {
        gender=1;
        type=1;
        return true;
    }
    if (s.length()<5) return false;
    temp+=s[s.length()-5];
    if (temp=="alail")
    {
        gender=2;
        type=1;
        return true;
    }
    if (s.length()<6) return false;
    temp+=s[s.length()-6];
    if (temp=="sitini")
    {
        gender=1;
        type=3;
        return true;
    }
    if (temp=="setini")
    {
        gender=2;
        type=3;
        return true;
    }
    return false;
}

int main()
{
    int genders[2]={0,0};
    int stage=0;
    string s;
    getline(cin,s);
    string temp;
    bool ok=true;
    if (s.find(" ")==string::npos && detect(s))
    {
        printf("YES\n");
        return 0;
    }
    rept(i,s.length()+1)
    {
        if (i==s.length() || s[i]==' ')
        {
            if (!detect(temp)) ok=false;
            else
            {
                genders[gender-1]++;
                if (stage==0 && type==1);
                else if (stage==0 && type==2) stage=1;
                else if (stage==1 && type==3) stage=2;
                else if (stage==2 && type==3);
                else ok=false;
            }
            temp.clear();
        }
        else temp+=s[i];
    }
    if (ok && genders[0]*genders[1]==0) printf("YES\n");
    else printf("NO\n");
    return 0;
}


#define _CRT_SECURE_NO_DEPRECATE

#include <iostream>
#include <cstdio>
#include <memory>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <list>
#include <stack>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <ctime>
#include <utility>

#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define LL long long
#define VI vector<int>
#define X first
#define Y second
#define sz(_v) ((int)_v.size())
#define all(_v) (_v).begin(),(_v).end()
#define FOR(i,a,b) for (int i(a); i<=(b); i++)
#define rep(i,a) FOR(i,1,a)
#define rept(i,a) FOR(i,0,a-1)
#define x1 X1
#define y1 Y1
#define sqr(a) ((a)*(a))
#define INF 2000000000

using namespace std;

int gender,type;

bool detect(string& s)
{
    if (s.length()<3) return false;
    string temp;
    rept(i,3) temp+=s[s.length()-1-i];
    if (temp=="rte")
    {
        gender=1;
        type=2;
        return true;
    }
    if (s.length()<4) return false;
    temp+=s[s.length()-4];
    if (temp=="arte")
    {
        gender=2;
        type=2;
        return true;
    }
    if (temp=="soil")
    {
        gender=1;
        type=1;
        return true;
    }
    if (s.length()<5) return false;
    temp+=s[s.length()-5];
    if (temp=="alail")
    {
        gender=2;
        type=1;
        return true;
    }
    if (s.length()<6) return false;
    temp+=s[s.length()-6];
    if (temp=="sitini")
    {
        gender=1;
        type=3;
        return true;
    }
    if (temp=="setini")
    {
        gender=2;
        type=3;
        return true;
    }
    return false;
}

int main()
{
    int genders[2]={0,0};
    int stage=0;
    string s;
    getline(cin,s);
    string temp;
    bool ok=true;
    rept(i,s.length()+1)
    {
        if (i==s.length() || s[i]==' ')
        {
            if (!detect(temp)) ok=false;
            else
            {
                genders[gender-1]++;
                if (stage==0 && type==1);
                else if (stage==0 && type==2) stage=1;
                else if (stage==1 && type==3) stage=3;
                else if (stage==2 && type==3);
                else ok=false;
            }
            temp.clear();
        }
        else temp+=s[i];
    }
    if (ok && genders[0]*genders[1]==0) printf("YES\n");
    else printf("NO\n");
    return 0;
}


//#include <stdafx.h>
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <ctime>

using namespace std;

const long maxlen=1e5+5;

vector <string> words;
string temp;
char text[maxlen];

inline void check(string s,long last,string need,long & r,long & ch,long t1,long t2)
{
	long slen=s.length();
	if (slen<last) return;
	string temp=s.substr(slen-last,slen);
	if (temp==need)
	{
		r=t1;
		ch=t2;
	}
}

void finishing()
{
	printf("NO");
	exit(0);
}

inline void work_with(string s,long & r,long & ch,bool & norm)
{
	r=-1;
	check(s,4,"lios",r,ch,1,1);
	check(s,5,"liala",r,ch,2,1);
	check(s,3,"etr",r,ch,1,2);
	check(s,4,"etra",r,ch,2,2);
	check(s,6,"initis",r,ch,1,3);
	check(s,6,"inites",r,ch,2,3);
	norm=(r!=-1);
}

inline void add_word(long s,long f)
{
	string nnew="";
	for (long k=s;k<=f;k++)
		nnew+=text[k];
	words.push_back(nnew);
}

int main()
{
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	long ch,r;
	bool norm;

	gets(text);
	words.resize(0);
	long start=0;
	long j;
	for (j=1;text[j]!=0;j++)
		if (text[j]==' ')
		{
			add_word(start,j-1);
			start=j+1;
		}
	add_word(start,j-1);

	if (words.size()==1)
	{
		work_with(words[0],r,ch,norm);
		if (norm) printf("YES");
		else printf("NO");
		return 0;
	}

	long step=1;
	long howmany=0;
	long rwas=-1;
	for (long h=0;h<words.size();h++)
	{
		work_with(words[h],r,ch,norm);
		if (!norm) finishing();
		if ((r!=rwas)&&(h!=0)) finishing();

		switch(step)
		{
		case 1:
			{
				if (ch==1) howmany++;
				else if (ch==2)
				{
					step++;
					howmany=1;
				}
				else finishing();
				break;
			}
		case 2:
			{
				if (ch==1) finishing();
				else if (ch==2)
				{
					howmany++;
					if (howmany>1) finishing();
				}
				else
				{
					step++;
					howmany=1;
				}
				break;
			}
		case 3:
			{
				if (ch<=2) finishing();
				else howmany++;
				break;
			}
		}
		rwas=r;
	}
	printf("YES");
}


//#include <stdafx.h>
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <ctime>

using namespace std;

const long maxlen=1e5+5;

vector <string> words;
string temp;
char text[maxlen];

inline void check(string s,long last,string need,long & r,long & ch,long t1,long t2)
{
	long slen=s.length();
	if (slen<last) return;
	string temp=s.substr(slen-last,slen);
	if (temp==need)
	{
		r=t1;
		ch=t2;
	}
}

void finishing()
{
	printf("NO");
	exit(0);
}

inline void work_with(string s,long & r,long & ch,bool & norm)
{
	r=-1;
	check(s,4,"lios",r,ch,1,1);
	check(s,5,"liala",r,ch,2,1);
	check(s,3,"etr",r,ch,1,2);
	check(s,4,"etra",r,ch,2,2);
	check(s,6,"initis",r,ch,1,3);
	check(s,6,"inites",r,ch,2,3);
	norm=(r!=-1);
}

inline void add_word(long s,long f)
{
	string nnew="";
	for (long k=s;k<=f;k++)
		nnew+=text[k];
	words.push_back(nnew);
}

int main()
{
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	long ch,r;
	bool norm;

	gets(text);
	words.resize(0);
	long start=0;
	long j;
	for (j=1;text[j]!=0;j++)
		if (text[j]==' ')
		{
			add_word(start,j-1);
			start=j+1;
		}
	add_word(start,j-1);

	if (words.size()==1)
	{
		work_with(words[0],r,ch,norm);
		if (norm) printf("YES");
		else printf("NO");
		return 0;
	}

	long step=1;
	long howmany=0;
	long rwas=-1;
	for (long h=0;h<words.size();h++)
	{
		work_with(words[h],r,ch,norm);
		if (!norm) finishing();
		if ((r!=rwas)&&(h!=0)) finishing();

		switch(step)
		{
		case 1:
			{
				if (ch==1) howmany++;
				else if (ch==2)
				{
					step++;
					howmany=1;
				}
				else finishing();
				break;
			}
		case 2:
			{
				if (ch==1) finishing();
				else if (ch==2)
				{
					howmany++;
					if (howmany>1) finishing();
				}
				else
				{
					step++;
					howmany=1;
				}
				break;
			}
		case 3:
			{
				if (ch<=2) finishing();
				else howmany++;
				break;
			}
		}
		if (step==1) finishing();
		rwas=r;
	}
	printf("YES");
}


//#include <stdafx.h>
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <ctime>

using namespace std;

const long maxlen=1e5+5;

vector <string> words;
string temp;
char text[maxlen];

inline void check(string s,long last,string need,long & r,long & ch,long t1,long t2)
{
	long slen=s.length();
	if (slen<last) return;
	string temp=s.substr(slen-last,slen);
	if (temp==need)
	{
		r=t1;
		ch=t2;
	}
}

void finishing()
{
	printf("NO");
	exit(0);
}

inline void work_with(string s,long & r,long & ch,bool & norm)
{
	r=-1;
	check(s,4,"lios",r,ch,1,1);
	check(s,5,"liala",r,ch,2,1);
	check(s,3,"etr",r,ch,1,2);
	check(s,4,"etra",r,ch,2,2);
	check(s,6,"initis",r,ch,1,3);
	check(s,6,"inites",r,ch,2,3);
	norm=(r!=-1);
}

inline void add_word(long s,long f)
{
	string nnew="";
	for (long k=s;k<=f;k++)
		nnew+=text[k];
	words.push_back(nnew);
}

int main()
{
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	long ch,r;
	bool norm;

	gets(text);
	words.resize(0);
	long start=0;
	long j;
	for (j=1;text[j]!=0;j++)
		if (text[j]==' ')
		{
			add_word(start,j-1);
			start=j+1;
		}
	add_word(start,j-1);

	if (words.size()==1)
	{
		work_with(words[0],r,ch,norm);
		if (norm) printf("YES");
		else printf("NO");
		return 0;
	}

	long step=1;
	long howmany=0;
	long rwas=-1;
	for (long h=0;h<words.size();h++)
	{
		work_with(words[h],r,ch,norm);
		if (!norm) finishing();
		if ((r!=rwas)&&(h!=0)) finishing();

		switch(step)
		{
		case 1:
			{
				if (ch==1) howmany++;
				else if (ch==2)
				{
					step++;
					howmany=1;
				}
				else finishing();
				break;
			}
		case 2:
			{
				if (ch==1) finishing();
				else if (ch==2)
				{
					howmany++;
					if (howmany>1) finishing();
				}
				else
				{
					step++;
					howmany=1;
				}
				break;
			}
		case 3:
			{
				if (ch<=2) finishing();
				else howmany++;
				break;
			}
		}
		rwas=r;
	}
	if (step==1) finishing();
	printf("YES");
}


//#include <stdafx.h>
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <ctime>

using namespace std;

const long maxlen=1e5+5;

vector <string> words;
string temp;
char text[maxlen];

inline void check(string s,long last,string need,long & r,long & ch,long t1,long t2)
{
	long slen=s.length();
	if (slen<last) return;
	string temp=s.substr(slen-last,slen);
	if (temp==need)
	{
		r=t1;
		ch=t2;
	}
}

void finishing()
{
	printf("NO");
	exit(0);
}

inline void work_with(string s,long & r,long & ch,bool & norm)
{
	r=-1;
	check(s,4,"lios",r,ch,1,1);
	check(s,5,"liala",r,ch,2,1);
	check(s,3,"etr",r,ch,1,2);
	check(s,4,"etra",r,ch,2,2);
	check(s,6,"initis",r,ch,1,3);
	check(s,6,"inites",r,ch,2,3);
	norm=(r!=-1);
}

inline void add_word(long s,long f)
{
	string nnew="";
	for (long k=s;k<=f;k++)
		nnew+=text[k];
	words.push_back(nnew);
}

int main()
{
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	long ch,r;
	bool norm;

	gets(text);
	words.resize(0);
	long start=0;
	long j;
	for (j=1;text[j]!=0;j++)
		if (text[j]==' ')
		{
			add_word(start,j-1);
			start=j+1;
		}
	add_word(start,j-1);

	if (words.size()==1)
	{
		work_with(words[0],r,ch,norm);
		if (norm) printf("YES");
		else printf("NO");
		return 0;
	}

	long step=1;
	long howmany=0;
	long rwas=-1;
	for (long h=0;h<words.size();h++)
	{
		work_with(words[h],r,ch,norm);
		if (!norm) finishing();
		if ((r!=rwas)&&(h!=0)) finishing();

		switch(step)
		{
		case 1:
			{
				if (ch==1) howmany++;
				else if (ch==2)
				{
					step++;
					howmany=1;
				}
				else finishing();
				break;
			}
		case 2:
			{
				if (ch==1) finishing();
				else if (ch==2)
				{
					howmany++;
					if (howmany>1) finishing();
				}
				else
				{
					step++;
					howmany=1;
				}
				break;
			}
		case 3:
			{
				if (ch<=2) finishing;
				else howmany++;
				break;
			}
		}
		rwas=r;
	}
	printf("YES");
}


#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <memory>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#pragma comment(linker,"/STACK:16777216")
using namespace std;
#define FOR(i,a,b) for(int i=a; i<b; i++)
#define F first
#define S second
#define INF 1000000000
typedef vector<int> llong;
typedef long long LL;
const long double eps=1e-7;
const long double pi=3.1415926535897932384626433832795;
LL pow_mod(LL a, LL n, LL mod) {
    long long res = 1;
    while (n) {
        if (n & 1)
            res *= a;
        res%=mod;
        a *= a;
        a%=mod;
        n >>= 1;
    }
    return res;
}
LL gcd (LL a, LL b) {
    return b ? gcd (b, a % b) : a;
}
char buf[200000];
int zak(string a){
    int n=a.size();
    string d;
    if (n>=4){
        d="";
        for (int i=4; i>0; i--)
            d+=a[n-i];
    }
    if (n>=4 && d=="lios")
        return 1;
    if (n>=5) {
        d="";
        for (int i=5; i>0; i--)
            d+=a[n-i];
    }
    if (a.size()>=5 && d=="liala")
        return 2;
    if (n>=3){
        d="";
        for (int i=3; i>0; i--)
            d+=a[n-i];
    }
    if (a.size()>=3 && d=="etr")
        return 3;
    if (n>=4) {
        d="";
        for (int i=4; i>0; i--)
            d+=a[n-i];
    }
    if (a.size()>=4 && d=="etra")
        return 4;
    if (n>=6){
        d="";
        for (int i=6; i>0; i--)
            d+=a[n-i];
    }
    if (a.size()>=6 && d=="initis")
        return 5;
    if (a.size()>=6 && d=="inites")
        return 6;
    return 0;
}
int main(){
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    gets(buf);
    string s=buf;
    s+=' ';
    string d="";
    vector<int> g;
    for (int i=0; i<s.size(); i++)
        if (s[i]==' '){
            int x=zak(d);
            //cout<<d<<" "<<x<<endl;
            g.push_back((x+1)/2);
            if (x==0){
                cout<<"NO"<<endl;
                return 0;
            }
            d="";
        }
        else
            d+=s[i];
    bool p=0;
    for (int i=0; i<g.size();  i++)
        if (g[i]==2)
            p=1;
    if (!p){
        cout<<"NO"<<endl;
        return 0;
    }
    for (int i=1; i<g.size(); i++)
        if (g[i]<g[i-1] || g[i]%2!=g[i-1]%2){
            cout<<"NO"<<endl;
            return 0;
        }
    cout<<"YES"<<endl;
    return 0;
}


#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <memory>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#pragma comment(linker,"/STACK:16777216")
using namespace std;
#define FOR(i,a,b) for(int i=a; i<b; i++)
#define F first
#define S second
#define INF 1000000000
typedef vector<int> llong;
typedef long long LL;
const long double eps=1e-7;
const long double pi=3.1415926535897932384626433832795;
LL pow_mod(LL a, LL n, LL mod) {
    long long res = 1;
    while (n) {
        if (n & 1)
            res *= a;
        res%=mod;
        a *= a;
        a%=mod;
        n >>= 1;
    }
    return res;
}
LL gcd (LL a, LL b) {
    return b ? gcd (b, a % b) : a;
}
char buf[200000];
int zak(string a){
    int n=a.size();
    string d;
    if (n>=4){
        d="";
        for (int i=4; i>0; i--)
            d+=a[n-i];
    }
    if (n>=4 && d=="lios")
        return 1;
    if (n>=5) {
        d="";
        for (int i=5; i>0; i--)
            d+=a[n-i];
    }
    if (a.size()>=5 && d=="liala")
        return 2;
    if (n>=3){
        d="";
        for (int i=3; i>0; i--)
            d+=a[n-i];
    }
    if (a.size()>=3 && d=="etr")
        return 3;
    if (n>=4) {
        d="";
        for (int i=4; i>0; i--)
            d+=a[n-i];
    }
    if (a.size()>=4 && d=="etra")
        return 4;
    if (n>=6){
        d="";
        for (int i=6; i>0; i--)
            d+=a[n-i];
    }
    if (a.size()>=6 && d=="initis")
        return 5;
    if (a.size()>=6 && d=="inites")
        return 6;
    return 0;
}
int main(){
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    gets(buf);
    string s=buf;
    s+=' ';
    string d="";
    vector<int> g,gg;
    int k=0;
    for (int i=0; i<s.size(); i++)
        if (s[i]==' '){
            int x=zak(d);
            //cout<<d<<" "<<x<<endl;
            k++;
            gg.push_back(x);
            g.push_back((x+1)/2);
            if (x==0){
                cout<<"NO"<<endl;
                return 0;
            }
            d="";
        }
        else
            d+=s[i];
    int p=0;
    if (k==1){
        cout<<"YES"<<endl;
        return 0;
    }
    for (int i=0; i<g.size();  i++)
        if (g[i]==2)
            p++;
    if (p!=1){
        cout<<"NO"<<endl;
        return 0;
    }
    for (int i=1; i<g.size(); i++)
        if (g[i]<g[i-1] || gg[i]%2!=gg[i-1]%2){
            cout<<"NO"<<endl;
            return 0;
        }
    cout<<"YES"<<endl;
    return 0;
}


#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <memory>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#pragma comment(linker,"/STACK:16777216")
using namespace std;
#define FOR(i,a,b) for(int i=a; i<b; i++)
#define F first
#define S second
#define INF 1000000000
typedef vector<int> llong;
typedef long long LL;
const long double eps=1e-7;
const long double pi=3.1415926535897932384626433832795;
LL pow_mod(LL a, LL n, LL mod) {
    long long res = 1;
    while (n) {
        if (n & 1)
            res *= a;
        res%=mod;
        a *= a;
        a%=mod;
        n >>= 1;
    }
    return res;
}
LL gcd (LL a, LL b) {
    return b ? gcd (b, a % b) : a;
}
char buf[200000];
int zak(string a){
    int n=a.size();
    string d;
    if (n>=4){
        d="";
        for (int i=4; i>0; i--)
            d+=a[n-i];
    }
    if (n>=4 && d=="lios")
        return 1;
    if (n>=5) {
        d="";
        for (int i=5; i>0; i--)
            d+=a[n-i];
    }
    if (a.size()>=5 && d=="liala")
        return 2;
    if (n>=3){
        d="";
        for (int i=3; i>0; i--)
            d+=a[n-i];
    }
    if (a.size()>=3 && d=="etr")
        return 3;
    if (n>=4) {
        d="";
        for (int i=4; i>0; i--)
            d+=a[n-i];
    }
    if (a.size()>=4 && d=="etra")
        return 4;
    if (n>=6){
        d="";
        for (int i=6; i>0; i--)
            d+=a[n-i];
    }
    if (a.size()>=6 && d=="initis")
        return 5;
    if (a.size()>=6 && d=="inites")
        return 6;
    return 0;
}
int main(){
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    gets(buf);
    string s=buf;
    s+=' ';
    string d="";
    vector<int> g,gg;
    for (int i=0; i<s.size(); i++)
        if (s[i]==' '){
            int x=zak(d);
            //cout<<d<<" "<<x<<endl;
            gg.push_back(x);
            g.push_back((x+1)/2);
            if (x==0){
                cout<<"NO"<<endl;
                return 0;
            }
            d="";
        }
        else
            d+=s[i];
    int p=0;
    for (int i=0; i<g.size();  i++)
        if (g[i]==2)
            p++;
    if (p!=1){
        cout<<"NO"<<endl;
        return 0;
    }
    for (int i=1; i<g.size(); i++)
        if (g[i]<g[i-1] || gg[i]%2!=gg[i-1]%2){
            cout<<"NO"<<endl;
            return 0;
        }
    cout<<"YES"<<endl;
    return 0;
}


#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <memory>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#pragma comment(linker,"/STACK:16777216")
using namespace std;
#define FOR(i,a,b) for(int i=a; i<b; i++)
#define F first
#define S second
#define INF 1000000000
typedef vector<int> llong;
typedef long long LL;
const long double eps=1e-7;
const long double pi=3.1415926535897932384626433832795;
LL pow_mod(LL a, LL n, LL mod) {
    long long res = 1;
    while (n) {
        if (n & 1)
            res *= a;
        res%=mod;
        a *= a;
        a%=mod;
        n >>= 1;
    }
    return res;
}
LL gcd (LL a, LL b) {
    return b ? gcd (b, a % b) : a;
}
char buf[200000];
int zak(string a){
    int n=a.size();
    string d;
    if (n>=4){
        d="";
        for (int i=4; i>0; i--)
            d+=a[n-i];
    }
    if (n>=4 && d=="lios")
        return 1;
    if (n>=5) {
        d="";
        for (int i=5; i>0; i--)
            d+=a[n-i];
    }
    if (a.size()>=5 && d=="liala")
        return 2;
    if (n>=3){
        d="";
        for (int i=3; i>0; i--)
            d+=a[n-i];
    }
    if (a.size()>=3 && d=="etr")
        return 3;
    if (n>=4) {
        d="";
        for (int i=4; i>0; i--)
            d+=a[n-i];
    }
    if (a.size()>=4 && d=="etra")
        return 4;
    if (n>=6){
        d="";
        for (int i=6; i>0; i--)
            d+=a[n-i];
    }
    if (a.size()>=6 && d=="initis")
        return 5;
    if (a.size()>=6 && d=="inites")
        return 6;
    return 0;
}
int main(){
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    gets(buf);
    string s=buf;
    s+=' ';
    string d="";
    vector<int> g,gg;
    for (int i=0; i<s.size(); i++)
        if (s[i]==' '){
            int x=zak(d);
            //cout<<d<<" "<<x<<endl;
            gg.push_back(x);
            g.push_back((x+1)/2);
            if (x==0){
                cout<<"NO"<<endl;
                return 0;
            }
            d="";
        }
        else
            d+=s[i];
    bool p=0;
    for (int i=0; i<g.size();  i++)
        if (g[i]==2)
            p=1;
    if (!p){
        cout<<"NO"<<endl;
        return 0;
    }
    for (int i=1; i<g.size(); i++)
        if (g[i]<g[i-1] || gg[i]%2!=gg[i-1]%2){
            cout<<"NO"<<endl;
            return 0;
        }
    cout<<"YES"<<endl;
    return 0;
}


#include <cassert>
#include <complex>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <limits>
#include <numeric>
#include <sstream>
#include <utility>

#include <algorithm>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

#include <memory.h>
//#include "bigint.h"

using namespace std;

#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define init(st) memset(st, 0, sizeof(st))
#define Pi 3.141592653589793

// String operations
template<class T>
void splitstr(const string &s, vector<T> &out) {
    istringstream in(s);
    out.clear();
    copy(istream_iterator<T>(in), istream_iterator<T>(), back_inserter(out));
}

template<class T>
T read_value(string s) {
    T result;
    istringstream sin(s);
    sin >> result;
    return result;
}

#define read_int(s) read_value<int>(s)
#define read_ll(s) read_value<ll>(s)
#define read_float(s) read_value<float>(s)
#define read_double(s) read_value<double>(s)

string read_line() {
    string ret_val;
    getline(std::cin, ret_val);
    return ret_val;
}

template<class T>
void init_array(T *arr, int size, T value) {
    for (int i = 0; i < size; i++)
        arr[i] = value;
}

// Arithmetic operations
template<class T>
inline T gcd(T a, T b) {
    return (!a) ? b : gcd(b % a, a);
}

template<class T>
inline T mod(T a, T p) {
    a %= p;
    return (a < 0) ? a + p : a;
}

template<class T>
inline int numbits(T n) {
    return (!n) ? 0 : 1 + numbits(n & (n - 1));
}

template<class T>
inline T inverse(T a, T m) {
    a = mod<T>(a,m);
    return (a==1) ? 1 : mod((1-m*inverse(m%a,a))/a,m);
}

template<class T>
inline bool is_prime(T a) {
    T lim = (T)sqrt((double)a);
    for (T i = 2; i <= T(lim+1E-9); i++)
        if (a % i == 0)
           return false;
    return true;
}

template<class T>
inline T power(T a, T p, T mod) {
    if (!p) return 1;
    T temp = power(a, p>>1, mod);
    temp = (temp * temp) % mod;
    if (p&1)
        temp = (temp * a) % mod;
    return temp;
}

void get_primes(int start, int end, vector<int> &vi) {
    bool *p = new bool[end + 1];
    init_array<bool>(p, end+1, 0); p[1] = 1;
    for (int i = 2; i <= end; i++) {
        if (!p[i]) {
            if (i >= start)
                    vi.push_back(i);
            for (int j = 2*i; j <= end; j += i)
                    p[j] = 1;
        }
    }
    delete [] p;
}

// Graph operations
bool dfs(int current, int final, int total, vector<int> &visited, vector< vector<bool> > &edges, bool flow) {
    if (current == final) return true;
    if (visited[current]) return false;
    visited[current] = true;
    for (int i = 0; i < total; i++)
        if (edges[current][i] && dfs(i, final, total, visited, edges, flow)) {
            if (flow) {
                edges[current][i] = false;
                edges[i][current] = true;
            }
            return true;
        }
    return false;
}

int flow(int in, int out, int total, vector< vector<bool> > &edges) {
    int result = 0;
    for (vector<int> visited(total, 0); dfs(in, out, total, visited, edges, true); ++result)
        visited = vector<int>(total, 0);
    return result;
}

// Disjoint datasets
void create_set(int x, int *P, int *rank) {
    P[x] = x;
    rank[x] = 0;
}

int find_set(int x, int *P) {
    if (x != P[x]) P[x] = find_set(P[x], P);
    return P[x];
}

bool merge_sets(int x, int y, int *P, int *rank) {
    int Px = find_set(x, P);
    int Py = find_set(y, P);
    if(Px == Py) return false;
    if (rank[Px] > rank[Py]) P[Py] = Px;
    else P[Px] = Py;
    if (rank[Px] == rank[Py]) rank[Py]++;
    return true;
}

// Binary tree operations
template <typename T>
int read_cum_freq(int index, T *tree) {
    int sum = 0;
    while (index) {
        sum += tree[index];
        index -= (index & -index);
    }
    return sum;
}

template <typename T>
void upd_freq(int index, int mxIndex, int value, T *tree) {
    while (index <= mxIndex) {
        tree[index] += value;
        index += (index & -index);
    }
}

template <typename T>
int read_freq(int index, T *tree) {
    return read_cum_freq(index, tree) - read_cum_freq(index-1, tree);
}

// String algos.
void build_failure_function(const string &str, int *temp_arr) {
    temp_arr[0] = temp_arr[1] = 0;
    for (int i = 2; i <= sz(str); i++) {
        temp_arr[i] = -1;
        for (int ind = temp_arr[i-1]; temp_arr[i] == -1; ind = temp_arr[ind]) {
            if (str[ind] == str[i-1]) {
                temp_arr[i] = ind + 1;
            } else if (ind == 0) {
                temp_arr[i] = 0;
            }
        }
    }
}

void KMP(const string &text, const string &pattern, int *res) {
    int *temp_arr = new int[sz(pattern) + 1];
    build_failure_function(pattern, temp_arr);
    int i = 0;
    int ind = 0;
    while (i < sz(text)) {
        if (text[i] == pattern[ind]) {
            res[i] = ++ind;
            if (res[i] == sz(pattern)) {
                ind = temp_arr[ind];
            }
            i++;
        } else if (ind == 0) {
            res[i++] = 0;
        } else {
            ind = temp_arr[ind];
        }
    }
    delete [] temp_arr;
}

template <typename T, int N>
struct matrix {
    T m[N][N];
    T md;

    matrix(T md, bool unary = false) {
        this->md = md;
        init(m);
        if (unary) {
            for (int i = 0; i < N; i++) {
                m[i][i] = 1;
            }
        }
    }

    matrix operator*(const matrix &that) const {
        matrix ret_val(md, false);
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                for (int k = 0; k < N; k++) {
                    ret_val.m[i][j] += this->m[i][k] * that.m[k][j];
                    ret_val.m[i][j] %= md;
                }
            }
        }
        return ret_val;
    }

    vector<T> operator*(const vector<T> &vec) const {
        vector<T> ret_val(vec.size(), 0);
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                ret_val[i] += m[i][j] * vec[j];
                ret_val[i] %= md;
            }
        }
        return ret_val;
    }

    matrix power(int pw) const {
        if (!pw) return matrix(md, true);
        if (pw == 1) return *this;
        matrix ret_val = power(pw>>1);
        ret_val = ret_val * ret_val;
        if (pw & 1) ret_val = ret_val * (*this);
        return ret_val;
    }
};

// Setup
void setup(int value, string name) {
    string name_in = name + ".in";
    string name_out = name + ".out";
    freopen(name_in.c_str(), "r", stdin);
    if (value) freopen(name_out.c_str(), "w", stdout);
}

int get_word(string &str) {
    reverse(str.begin(), str.end());
    if (str.find("soil") == 0) return 0;
    if (str.find("alail") == 0) return 1;
    if (str.find("rte") == 0) return 2;
    if (str.find("arte") == 0) return 3;
    if (str.find("sitini") == 0) return 4;
    if (str.find("setini") == 0) return 5;
    return -1;
}

int main() {
#ifdef LOCAL_HOST
    setup(0, "temp");
#endif
    vector<int> vi;
    string str;
    int mask = 0;
    while (std::cin >> str) {
        int group = get_word(str);
        if (group == -1) {
            std::cout << "NO" << std::endl; return 0;
        }
        mask |= (1 << (group & 1));
        vi.push_back(group / 2);
    }
    if (mask == 3) {
        std::cout << "NO" << std::endl; return 0;
    }
    if (vi.size() == 1) {
        std::cout << "YES" << std::endl; return 0;
    }
    if (count(vi.begin(), vi.end(), 1) != 1) {
        std::cout << "NO" << std::endl; return 0;
    }
    vi.erase(unique(vi.begin(), vi.end()), vi.end());
    if (count(vi.begin(), vi.end(), 0) > 1 ||
        count(vi.begin(), vi.end(), 2) > 1) {
            std::cout << "NO" << std::endl; return 0;
    }
    if (count(vi.begin(), vi.end(), 0) && vi[0] != 0) {
        std::cout << "NO" << std::endl; return 0;
    }
    if (count(vi.begin(), vi.end(), 2) && vi.back() != 2) {
        std::cout << "NO" << std::endl; return 0;
    }
    std::cout << "YES" << std::endl;
    return 0;
}


#include <cassert>
#include <complex>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <limits>
#include <numeric>
#include <sstream>
#include <utility>

#include <algorithm>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

#include <memory.h>
//#include "bigint.h"

using namespace std;

#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define init(st) memset(st, 0, sizeof(st))
#define Pi 3.141592653589793

// String operations
template<class T>
void splitstr(const string &s, vector<T> &out) {
    istringstream in(s);
    out.clear();
    copy(istream_iterator<T>(in), istream_iterator<T>(), back_inserter(out));
}

template<class T>
T read_value(string s) {
    T result;
    istringstream sin(s);
    sin >> result;
    return result;
}

#define read_int(s) read_value<int>(s)
#define read_ll(s) read_value<ll>(s)
#define read_float(s) read_value<float>(s)
#define read_double(s) read_value<double>(s)

string read_line() {
    string ret_val;
    getline(std::cin, ret_val);
    return ret_val;
}

template<class T>
void init_array(T *arr, int size, T value) {
    for (int i = 0; i < size; i++)
        arr[i] = value;
}

// Arithmetic operations
template<class T>
inline T gcd(T a, T b) {
    return (!a) ? b : gcd(b % a, a);
}

template<class T>
inline T mod(T a, T p) {
    a %= p;
    return (a < 0) ? a + p : a;
}

template<class T>
inline int numbits(T n) {
    return (!n) ? 0 : 1 + numbits(n & (n - 1));
}

template<class T>
inline T inverse(T a, T m) {
    a = mod<T>(a,m);
    return (a==1) ? 1 : mod((1-m*inverse(m%a,a))/a,m);
}

template<class T>
inline bool is_prime(T a) {
    T lim = (T)sqrt((double)a);
    for (T i = 2; i <= T(lim+1E-9); i++)
        if (a % i == 0)
           return false;
    return true;
}

template<class T>
inline T power(T a, T p, T mod) {
    if (!p) return 1;
    T temp = power(a, p>>1, mod);
    temp = (temp * temp) % mod;
    if (p&1)
        temp = (temp * a) % mod;
    return temp;
}

void get_primes(int start, int end, vector<int> &vi) {
    bool *p = new bool[end + 1];
    init_array<bool>(p, end+1, 0); p[1] = 1;
    for (int i = 2; i <= end; i++) {
        if (!p[i]) {
            if (i >= start)
                    vi.push_back(i);
            for (int j = 2*i; j <= end; j += i)
                    p[j] = 1;
        }
    }
    delete [] p;
}

// Graph operations
bool dfs(int current, int final, int total, vector<int> &visited, vector< vector<bool> > &edges, bool flow) {
    if (current == final) return true;
    if (visited[current]) return false;
    visited[current] = true;
    for (int i = 0; i < total; i++)
        if (edges[current][i] && dfs(i, final, total, visited, edges, flow)) {
            if (flow) {
                edges[current][i] = false;
                edges[i][current] = true;
            }
            return true;
        }
    return false;
}

int flow(int in, int out, int total, vector< vector<bool> > &edges) {
    int result = 0;
    for (vector<int> visited(total, 0); dfs(in, out, total, visited, edges, true); ++result)
        visited = vector<int>(total, 0);
    return result;
}

// Disjoint datasets
void create_set(int x, int *P, int *rank) {
    P[x] = x;
    rank[x] = 0;
}

int find_set(int x, int *P) {
    if (x != P[x]) P[x] = find_set(P[x], P);
    return P[x];
}

bool merge_sets(int x, int y, int *P, int *rank) {
    int Px = find_set(x, P);
    int Py = find_set(y, P);
    if(Px == Py) return false;
    if (rank[Px] > rank[Py]) P[Py] = Px;
    else P[Px] = Py;
    if (rank[Px] == rank[Py]) rank[Py]++;
    return true;
}

// Binary tree operations
template <typename T>
int read_cum_freq(int index, T *tree) {
    int sum = 0;
    while (index) {
        sum += tree[index];
        index -= (index & -index);
    }
    return sum;
}

template <typename T>
void upd_freq(int index, int mxIndex, int value, T *tree) {
    while (index <= mxIndex) {
        tree[index] += value;
        index += (index & -index);
    }
}

template <typename T>
int read_freq(int index, T *tree) {
    return read_cum_freq(index, tree) - read_cum_freq(index-1, tree);
}

// String algos.
void build_failure_function(const string &str, int *temp_arr) {
    temp_arr[0] = temp_arr[1] = 0;
    for (int i = 2; i <= sz(str); i++) {
        temp_arr[i] = -1;
        for (int ind = temp_arr[i-1]; temp_arr[i] == -1; ind = temp_arr[ind]) {
            if (str[ind] == str[i-1]) {
                temp_arr[i] = ind + 1;
            } else if (ind == 0) {
                temp_arr[i] = 0;
            }
        }
    }
}

void KMP(const string &text, const string &pattern, int *res) {
    int *temp_arr = new int[sz(pattern) + 1];
    build_failure_function(pattern, temp_arr);
    int i = 0;
    int ind = 0;
    while (i < sz(text)) {
        if (text[i] == pattern[ind]) {
            res[i] = ++ind;
            if (res[i] == sz(pattern)) {
                ind = temp_arr[ind];
            }
            i++;
        } else if (ind == 0) {
            res[i++] = 0;
        } else {
            ind = temp_arr[ind];
        }
    }
    delete [] temp_arr;
}

template <typename T, int N>
struct matrix {
    T m[N][N];
    T md;

    matrix(T md, bool unary = false) {
        this->md = md;
        init(m);
        if (unary) {
            for (int i = 0; i < N; i++) {
                m[i][i] = 1;
            }
        }
    }

    matrix operator*(const matrix &that) const {
        matrix ret_val(md, false);
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                for (int k = 0; k < N; k++) {
                    ret_val.m[i][j] += this->m[i][k] * that.m[k][j];
                    ret_val.m[i][j] %= md;
                }
            }
        }
        return ret_val;
    }

    vector<T> operator*(const vector<T> &vec) const {
        vector<T> ret_val(vec.size(), 0);
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                ret_val[i] += m[i][j] * vec[j];
                ret_val[i] %= md;
            }
        }
        return ret_val;
    }

    matrix power(int pw) const {
        if (!pw) return matrix(md, true);
        if (pw == 1) return *this;
        matrix ret_val = power(pw>>1);
        ret_val = ret_val * ret_val;
        if (pw & 1) ret_val = ret_val * (*this);
        return ret_val;
    }
};

// Setup
void setup(int value, string name) {
    string name_in = name + ".in";
    string name_out = name + ".out";
    freopen(name_in.c_str(), "r", stdin);
    if (value) freopen(name_out.c_str(), "w", stdout);
}

int get_word(string &str) {
    reverse(str.begin(), str.end());
    if (str.find("soil") == 0) return 0;
    if (str.find("alail") == 0) return 1;
    if (str.find("rte") == 0) return 2;
    if (str.find("arte") == 0) return 3;
    if (str.find("sitini") == 0) return 4;
    if (str.find("setini") == 0) return 5;
    return -1;
}

int main() {
#ifdef LOCAL_HOST
    setup(0, "temp");
#endif
    vector<int> vi;
    string str;
    int mask = 0;
    while (std::cin >> str) {
        int group = get_word(str);
        if (group == -1) {
            std::cout << "NO" << std::endl; return 0;
        }
        mask |= (1 << (group & 1));
        vi.push_back(group / 2);
    }
    if (mask == 3) {
        std::cout << "NO" << std::endl; return 0;
    }
    if (vi.size() == 1) {
        std::cout << "YES" << std::endl; return 0;
    }
    if (count(vi.begin(), vi.end(), 1) != 1) {
        std::cout << "NO" << std::endl; return 0;
    }
    vi.erase(vi.begin(), unique(vi.begin(), vi.end()));
    if (count(vi.begin(), vi.end(), 0) > 1 ||
        count(vi.begin(), vi.end(), 2) > 1) {
            std::cout << "NO" << std::endl; return 0;
    }
    if (count(vi.begin(), vi.end(), 0) && vi[0] != 0) {
        std::cout << "NO" << std::endl; return 0;
    }
    if (count(vi.begin(), vi.end(), 2) > 1) && vi.back() != 2) {
        std::cout << "NO" << std::endl; return 0;
    }
    std::cout << "YES" << std::endl;
    return 0;
}