#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
using namespace std;

int n;
struct node
{
	string s;
	bool operator < (const node &x) const
	{
		int lena=s.size(),lenb=x.s.size();
		if (lena!=lenb)
		{
			for (int i=0;i<lena;i++)
				if (s[i]!=x.s[i])
					return s[i]<x.s[i];
			return 0;
		}
		else return lena<lenb;
	}
}a[411];

long long read()
{
	long long x=0,f=1;char c=getchar();
	while (!isdigit(c)) {if (c=='-')f=-1;c=getchar();}
	while (isdigit(c)) {x=x*10+c-'0';c=getchar();}
	return x*f;
}

void write(long long x)
{
	if (x<0) putchar('-'),x=-x;if (x>=10) write(x/10);
	putchar(x%10+'0');
}

void writern(long long x)
{
	write(x),putchar(' ');
}

void writeln(long long x)
{
	 write(x),puts("");
}

int main()
{
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	n=read();
	for (int i=1;i<=n;i++)
		cin >> a[i].s;
	for (int i=1;i<=n;i++)
	{
		for (int j=a[i].s.size()-1;j>=0;j--)
		{
			if (a[i].s[j]=='h')
			{
				int r=j;
				while (j>0&&a[i].s[j-1]=='k')
				{
					j--;
				}
				a[i].s.erase(j,r-j);
			}
			if (a[i].s[j]=='u')
			{
				a[i].s.erase(j,1);a[i].s.insert(j,2,'o');
			}
		}
	}
	sort(a+1,a+n+1);
	int cnt=0;
	for (int i=1;i<=n;i++)
	{
		if (i==1 || a[i].s!=a[i-1].s)
			cnt++;
	}
	writeln(cnt);
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
bool check(string a,string b){
    int i=0,j=0;
    for(;i<a.size()&&j<b.size();i++,j++){
        if(a[i]==b[j])continue;
        else if(a[i]=='u'&&b[j]=='o'&&j+1<b.size()&&b[j+1]=='o'){
            j++;
        }
        else if(b[j]=='u'&&a[i]=='o'&&i+1<a.size()&&a[i+1]=='o'){
            i++;
        }
        else if(a[i]=='u'&&b[j]=='o'&&j+1<b.size()&&b[j+1]=='u'){
            b[j+1]='o';
        }
        else if(b[j]=='u'&&a[i]=='o'&&i+1<a.size()&&a[i+1]=='u'){
            a[i+1]='o';
        }
        else if(a[i]=='h'&&b[j]=='k'){
            while(b[j]=='k'&&j+1<b.size()){
                j++;
            }
            if(b[j]!='h')return false;

        }
        else if(b[j]=='h'&&a[i]=='k'){
            while(a[i]=='k'&&i+1<a.size()){
                i++;
            }
            if(a[i]!='h')return false;
        }
        else return false;
    }
    if(i!=a.size()||j!=b.size())return false;
    else return true;
}

int main()
{
    int n;
    cin>>n;
    string arr[n];
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    bool father[n];
    memset(father,false,n);
    sort(arr,arr+n);
    for(int i=0;i<n;i++){
        if(father[i])continue;
        for(int j=i+1;j<n;j++){
            if(i==j){
                continue;
            }
            if(check(arr[i],arr[j])){
                father[j]=true;
            }
        }
    }
    int cnt=0;
    for(int i=0;i<n;i++){
        if(!father[i]){
            cnt++;
        }
    }
    cout<<cnt<<endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
bool check(string a,string b){
    int i=0,j=0;
    for(;i<a.size()&&j<b.size();i++,j++){
        if(a[i]==b[j])continue;
        else if(a[i]=='u'&&b[j]=='o'&&j+1<b.size()&&b[j+1]=='o'){
            j++;
        }
        else if(b[j]=='u'&&a[i]=='o'&&i+1<a.size()&&a[i+1]=='o'){
            i++;
        }
        else if(a[i]=='u'&&b[j]=='o'&&j+1<b.size()&&b[j+1]=='u'){
            b[j+1]='o';
        }
        else if(b[j]=='u'&&a[i]=='o'&&i+1<a.size()&&a[i+1]=='u'){
            a[i+1]='o';
        }
        else if(a[i]=='h'&&b[j]=='k'){
            while(b[j]=='k'&&j+1<b.size()){
                j++;
            }
            if(b[j]!='h')return false;

        }
        else if(b[j]=='h'&&a[i]=='k'){
            while(a[i]=='k'&&i+1<a.size()){
                i++;
            }
            if(a[i]!='h')return false;
        }
        else return false;
    }
    if(i!=a.size()||j!=b.size())return false;
    else return true;
}

int main()
{
    int n;
    cin>>n;
    string name[n];
    for(int i=0;i<n;i++){
        cin>>name[i];
    }
    sort(name,name+n);
    bool alone[n];
    memset(alone,false,n);
    for(int i=0;i<n;i++){
        if(alone[i])continue;
        for(int j=i+1;j<n;j++){
            if(i==j)continue;
            if(check(name[i],name[j])){
                alone[j]=true;
            }
        }
    }
    int cnt=0;
    for(int i=0;i<n;i++){
        if(!alone[i])cnt++;
    }
    cout<<cnt<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define maxn 420
char data[maxn][50];
char tmp[50];
char nc[50];
bool vis[maxn];
int main()
{
    int n;
    int i,j;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        char* p=tmp;
        scanf("%s",p);

        int len=strlen(p);
        int pos=0;
        for(j=0;j<len;j++)
        {
            if(p[j]=='u')
            {
                nc[pos++]='o';
                nc[pos++]='o';
            }
            else if(pos!=0)
            {

                if(p[j]=='h'&&nc[pos-1]=='k')
                {
                    pos--;

                    while(pos!=0&&nc[pos-1]=='k')
                    {
                        pos--;
                    }
                    nc[pos++]='h';
                }
                else
                {
                    nc[pos++]=p[j];
                }
            }
            else
            {
                nc[pos++]=p[j];
            }
        }
        nc[pos++]='\0';
        strcpy(data[i],nc);
    }
    memset(vis,0,sizeof(vis));
    int sum=0;
    //puts("");
    for(i=0;i<n;i++)
    {
        //puts(data[i]);
        if(vis[i])
            continue;
        vis[i]=true;
        bool f=false;
        for(j=0;j<n;j++)
        {

            if(!vis[j])
            {
                if(strcmp(data[i],data[j])==0)
                {
                    vis[j]=true;
                    f=true;
                }
            }
        }

        sum++;
    }
    printf("%d\n",sum);
    return 0;

}


#include<bits/stdc++.h>
using namespace std;
#define maxn 420
char data[maxn][24];
char tmp[24];
char nc[24];
bool vis[maxn];
int main()
{
    int n;
    int i,j;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        char* p=tmp;
        scanf("%s",p);

        int len=strlen(p);
        int pos=0;
        for(j=0;j<len;j++)
        {
            if(p[j]=='u')
            {
                nc[pos++]='o';
                nc[pos++]='o';
            }
            else if(pos!=0)
            {

                if(p[j]=='h'&&nc[pos-1]=='k')
                {
                    pos--;
                    while(p[j+1]=='h')j++;
                    while(pos!=0&&nc[pos-1]=='k')
                    {
                        pos--;
                    }
                    nc[pos++]='h';
                }
                else
                {
                    nc[pos++]=p[j];
                }
            }
            else
            {
                nc[pos++]=p[j];
            }
        }
        nc[pos++]='\0';
        strcpy(data[i],nc);
    }
    memset(vis,0,sizeof(vis));
    int sum=0;
    //puts("");
    for(i=0;i<n;i++)
    {
        //puts(data[i]);
        if(vis[i])
            continue;
        vis[i]=true;
        bool f=false;
        for(j=0;j<n;j++)
        {

            if(!vis[j])
            {
                if(strcmp(data[i],data[j])==0)
                {
                    vis[j]=true;
                    f=true;
                }
            }
        }

        sum++;
    }
    printf("%d\n",sum);
    return 0;

}


#include<bits/stdc++.h>
using namespace std;
#define maxn 420
char data[maxn][24];
char tmp[24];
char nc[24];
bool vis[maxn];
int main()
{
    int n;
    int i,j;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        char* p=tmp;
        scanf("%s",p);

        int len=strlen(p);
        int pos=0;
        for(j=0;j<len;j++)
        {
            if(p[j]=='u')
            {
                nc[pos++]='o';
                nc[pos++]='o';
            }
            else if(pos!=0)
            {

                if(p[j]=='h'&&nc[pos-1]=='k')
                {
                    pos--;
                    while(pos!=0&&nc[pos-1]=='k')
                    {
                        pos--;
                    }
                    nc[pos++]='h';
                }
                else
                {
                    nc[pos++]=p[j];
                }
            }
            else
            {
                nc[pos++]=p[j];
            }
        }
        nc[pos++]='\0';
        strcpy(data[i],nc);
    }
    memset(vis,0,sizeof(vis));
    int sum=0;
    //puts("");
    for(i=0;i<n;i++)
    {
        //puts(data[i]);
        if(vis[i])
            continue;
        vis[i]=true;
        bool f=false;
        for(j=0;j<n;j++)
        {

            if(!vis[j])
            {
                if(strcmp(data[i],data[j])==0)
                {
                    vis[j]=true;
                    f=true;
                }
            }
        }

        sum++;
    }
    printf("%d\n",sum);
    return 0;

}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<map>
using namespace std;
map<string,int> st;
string s[500];
int ans=0,n;
//  oo->u     kh->h
string ch(string x)
{
	string A="u";
	string B="h";
	int flag;
	flag=1;
	while(flag)
	{
		flag=0;
		for(int i=1;i<x.length();i++){
			if(x[i]==x[i-1]&&x[i]=='o'){
				flag=1;
				x.replace(i-1,2,A);
				break;
			}
			if(x[i]=='h'&&x[i-1]=='k'){
				flag=1;
				x.replace(i-1,2,B);
				break;
			}
		}
	}
	for(int i=1;i<x.length();i++)
		if(x[i]=='u'&&x[i-1]=='o'){
			char L=x[i];
			x[i]=x[i-1];
			x[i-1]=L;
	}
	flag=1;
	while(flag)
	{
		flag=0;
		for(int i=1;i<x.length();i++){
			if(x[i]==x[i-1]&&x[i]=='o'){
				flag=1;
				x.replace(i-1,2,A);
				break;
			}
			if(x[i]=='h'&&x[i-1]=='k'){
				flag=1;
				x.replace(i-1,2,B);
				break;
			}
		}
	}
	for(int i=1;i<x.length();i++)
		if(x[i]=='u'&&x[i-1]=='o'){
			char L=x[i];
			x[i]=x[i-1];
			x[i-1]=L;
	}
	flag=1;
	while(flag)
	{
		flag=0;
		for(int i=1;i<x.length();i++){
			if(x[i]==x[i-1]&&x[i]=='o'){
				flag=1;
				x.replace(i-1,2,A);
				break;
			}
			if(x[i]=='h'&&x[i-1]=='k'){
				flag=1;
				x.replace(i-1,2,B);
				break;
			}
		}
	}
	return x;
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		cin>>s[i];
		s[i]=ch(s[i]);
//		cout<<s[i]<<endl;
	}
//	cout<<endl;
	for(int i=1;i<=n;i++){
		 if(!st[s[i]]){
//		 	cout<<s[i]<<endl;
		 	st[s[i]]++;
		 	ans++;
		 }
	}
	printf("%d\n",ans);
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<map>
using namespace std;
map<string,int> st;
string s[500];
int ans=0,n;
//  oo->u     kh->h
string ch(string x)
{
	string A="u";
	string B="h";
	int flag,sig;
	sig=1;
	while(sig){
		sig=0;
		flag=1;
		while(flag)
		{
			flag=0;
			for(int i=1;i<x.length();i++){
				if(x[i]==x[i-1]&&x[i]=='o'){
					flag=1;
					x.replace(i-1,2,A);
					break;
				}
				if(x[i]=='h'&&x[i-1]=='k'){
					flag=1;
					x.replace(i-1,2,B);
					break;
				}
			}
		}
		for(int i=1;i<x.length();i++)
			if(x[i]=='u'&&x[i-1]=='o'){
				char L=x[i];
				x[i]=x[i-1];
				x[i-1]=L;
				sig=1;
			}
	}

	return x;
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		cin>>s[i];
		s[i]=ch(s[i]);
	}
	for(int i=1;i<=n;i++){
		 if(!st[s[i]]){
		 	st[s[i]]++;
		 	ans++;
		 }
	}
	printf("%d\n",ans);
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<map>
using namespace std;
map<string,int> st;
string s[500];
int ans=0,n;
//  oo->u     kh->h
string ch(string x)
{
	string A="u";
	string B="h";
	int flag=1;
	flag=1;
	while(flag)
	{
		flag=0;
		for(int i=x.length()-1;i>=1;i--){
			if(x[i]==x[i-1]&&x[i]=='o'){
				flag=1;
				x.replace(i-1,2,A);
				break;
			}
			if(x[i]=='h'&&x[i-1]=='k'){
				flag=1;
				x.replace(i-1,2,B);
				break;
			}
		}
	}
	for(int i=1;i<x.length();i++)
		if(x[i]=='u'&&x[i-1]=='o'){
			char L=x[i];
			x[i]=x[i-1];
			x[i-1]=L;
	}
	return x;
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		cin>>s[i];
		s[i]=ch(s[i]);
//		cout<<s[i]<<endl;
	}
	for(int i=1;i<=n;i++){
		 if(!st[s[i]]){
//		 	cout<<s[i]<<endl;
		 	st[s[i]]++;
		 	ans++;
		 }
	}
	printf("%d\n",ans);
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<map>
using namespace std;
map<string,int> st;
string s[500];
int ans=0,n;
//  oo->u     kh->h
string ch(string x)
{
	string A="u";
	string B="h";
	int flag=1;
	flag=1;
	while(flag)
	{
		flag=0;
		for(int i=1;i<x.length();i++){
			if(x[i]==x[i-1]&&x[i]=='o'){
				flag=1;
				x.replace(i-1,2,A);
				break;
			}
			if(x[i]=='h'&&x[i-1]=='k'){
				flag=1;
				x.replace(i-1,2,B);
				break;
			}
		}
	}
	for(int i=1;i<x.length();i++)
		if(x[i]=='u'&&x[i-1]=='o'){
			char L=x[i];
			x[i]=x[i-1];
			x[i-1]=L;
	}
	return x;
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		cin>>s[i];
		s[i]=ch(s[i]);
	}
	for(int i=1;i<=n;i++){
		 if(!st[s[i]]){
		 	st[s[i]]++;
		 	ans++;
		 }
	}
	printf("%d\n",ans);
}


#include<bits/stdc++.h>
#define ll long long
#define N 1000005
#define For(i,x,y) for(int i=x;i<=y;i++)
#define Rep(i,x,y) for(int i=x;i>=y;i--)
using namespace std;
inline int read(){
	int x=0,f=0;char ch=getchar();
	for(;ch<'0'||ch>'9';ch=getchar()) if(ch=='-') f=1;
	for(;ch>='0'&&ch<='9';ch=getchar()) x=(x<<1)+(x<<3)+ch-48;
	return f?-x:x;
}
string s;
map <string,int> mp;
int ans;
int main(){
	int n=read();
	For(i,1,n){
		cin>>s;string pp;
		int p=s.length(),g=-1;
		For(i,0,p-1){
			if(s[i]=='u') pp+="oo",g+=2;
			else if(s[i]=='h'){
				if(g!=-1&&pp[g]=='k'){
					pp.erase(pp.end()-1);g--;
					while(g!=-1&&pp[g]=='k'){
						pp.erase(pp.end()-1);g--;
					}
					pp+='h';g++;
				}else pp+='h',g++;
			}else pp+=s[i],g++;
		}
	//	cout<<endl;
	//	cout<<pp<<endl;
		if(!mp[pp]) mp[pp]=1,ans++;
	}
	cout<<ans;
	return 0;
}


#include <iostream>
#include<ostream>
#include <vector>
#include <cmath>
#include<string>
#include<map>
#include<set>
using namespace std;

string s1(string str){

	for(int i = 0 ; i < str.size() ; i++){

			if(str[i]=='u'){

				str[i]='o';
				str.insert(str.begin()+i,'o');
				i=-1;

			}
			else if(i<str.size()-1 && str[i]=='k' && str[i+1]=='h'){

				str.erase(str.begin()+i);
				str[i]='h';
				i=-1;
			}

		}

	return str;
}

int main(){
	int x;
	cin>>x;
	map<string,int>m;
	string str;
	for(int j=x;j!=0;j--){

		cin>>str;
		str = s1(str);
		m[str]++;;
	}
	cout<<m.size()<<endl<<endl;

	return 0;
}


#include <bits/stdc++.h>

using namespace std;
vector <string> tud;
string  h;
int n;
char a;
int main()
{
    scanf("%d",&n);
    scanf("%c",&a);
    for (int i=0;i<n;i++)
        {
            cin >> h;
            tud.push_back(h);
        };
        for (int i=0;i<n;i++)
        {

            for (int j=0;j<tud[i].size();j++)
            {
                if (tud[i][j]=='u') {tud[i].insert(j,"oo",2);tud[i].erase(tud[i].begin()+j+2,tud[i].begin()+j+3);};
            };
            int vitrik=0;
            bool k=true;
            while (vitrik!=-1 && k)
        {
            vitrik=-1;k=false;
            for (int j=0;j<tud[i].size();j++)
            {
                if (tud[i][j]=='k' && vitrik==-1) vitrik=j;
                if (vitrik!=-1 && !(tud[i][j]=='k' || tud[i][j]=='h')) vitrik=-1;
                if (tud[i][j]=='h' && vitrik!=-1) {tud[i].erase(tud[i].begin()+vitrik,tud[i].begin()+j);k=true;break;};
            };
        };
        };

        map<string,bool> T;
        int kq=0;
        for (int i=0;i<n;i++)
            if (!T[tud[i]]) {kq++;T[tud[i]]=true;};
            printf("%d",kq);

    return 0;
}


#include <bits/stdc++.h>

using namespace std;
vector <string> tud;
string  h;
int n;
char a;
int main()
{
    scanf("%d",&n);
    scanf("%c",&a);
    for (int i=0;i<n;i++)
        {
            cin >> h;
            tud.push_back(h);
        };
        for (int i=0;i<n;i++)
        {

            for (int j=0;j<tud[i].size();j++)
            {
                if (tud[i][j]=='u') {tud[i].insert(j,"oo",2);tud[i].erase(tud[i].begin()+j+2,tud[i].begin()+j+3);};
            };
            int vitrik=0;
            bool k=true;
            while (vitrik!=-1 && k)
        {
            vitrik=-1;k=false;
            for (int j=0;j<tud[i].size();j++)
            {
                if (tud[i][j]=='k' && vitrik==-1) vitrik=j;
                if (tud[i][j]=='h' && vitrik!=-1) {tud[i].erase(tud[i].begin()+vitrik,tud[i].begin()+j);k=true;break;};
            };
        };
        };

        map<string,bool> T;
        int kq=0;
        for (int i=0;i<n;i++)
            if (!T[tud[i]]) {kq++;T[tud[i]]=true;};
            printf("%d",kq);

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
vector <string> res;
set <string> ss;
int main()
{
    freopen("input.txt", "r", stdin);
  //  freopen("output.txt", "w", stdout);
    int n;
    cin >> n;
    for(int i = 1; i<=n; i++)
    {
        string d;
        cin >> d;
        int z = d.size();
        string s1 = "";
        for(int j = 0; j < z; j++)
        {
            if (d[j] == 'o'&& d[j+1]=='o')
            {
                s1.push_back('u');
                j++;
                //j++;
                //kk++;
                continue;
            }
            s1.push_back(d[j]);
        }

        d = s1;
        z = d.size();
        int kk = 1;
        string s = "";
        for(int j = 0; j < z; j++)
        {
            if (d[j] != 'k')
            {
                s.push_back(d[j]);
                continue;
            }
            //j++;
           int k = 0;
            while(j <z  && d[j] == 'k')
            {
                s.push_back(d[j]);
                j++;
                k++;
            }
            if (d[j] != 'h')
            {
               // s.push_back('k');
               j--;
               continue;

            }
            else
            {
                s.resize(j-k);
                j--;
            }

           // s.push_back('h');

        }

        res.push_back(s);

    }
    for(int i = 0; i < n; i++)
    {
        ss.insert(res[i]);
    }
    cout << ss.size() << endl;

}


#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
using namespace std;
vector<string>ans1;
set<string>ans;
int main()
{
//    freopen("input.txt","r",stdin);
//freopen("o.txt","w",stdout);
    int n;
    cin>>n;
string sss;
    for(int i=0;i<n;i++)
    {

        cin>>sss;
        int si=sss.size();
        string s1;
        for(int j=0;j<si;j++)
                if(sss[j]=='u')
            {
                s1.push_back('o');s1.push_back('o');
            }
            else s1.push_back(sss[j]);
        sss=s1;
        si=sss.size();
        string s;
        for(int zz=0;zz<si;zz++)
        {
            if(sss[zz]!='k')s.push_back(sss[zz]);
            else
            {
                long long  k1=0;
                string ssss;
                while(sss[zz]=='k'&&zz<si)
                {
                    ssss.push_back(sss[zz]);
                    zz++;
                    k1++;
                }
                if(sss[zz]!='h')
                {
                    zz--;
                    for(int l=0;l<k1;l++) s.push_back(ssss[l]);
                }
                else zz--;
            }
        }
        ans1.pb(s);
    }
    for(int i=0;i<n;i++) ans.insert(ans1[i]);
    cout<<ans.size()<<endl;

}


#include <bits/stdc++.h>
using namespace std;
vector <string> res;
set <string> ss;
int main()
{
    freopen("input.txt", "r", stdin);
  //  freopen("output.txt", "w", stdout);
    int n;
    cin >> n;
    for(int i = 1; i<=n; i++)
    {
        string d;
        cin >> d;
        int z = d.size();
        string s1 = "";
        for(int j = 0; j < z; j++)
        {
            if (d[j] == 'u')
            {
                s1.push_back('o');
                s1.push_back('o');
                //j++;
                //kk++;
                continue;
            }
            s1.push_back(d[j]);
        }

        d = s1;
        z = d.size();
        int kk = 1;
        string s = "";
        for(int j = 0; j < z; j++)
        {
            if (d[j] != 'k')
            {
                s.push_back(d[j]);
                continue;
            }

            //j++;

           int k = 0;
string o = "";
            while(j <z  && d[j] == 'k')
            {
                o.push_back(d[j]);
                j++;
                k++;
            }

            if (d[j] != 'h')
            {
               // s.push_back('k');
               j--;
               continue;

            }

            else
            {
                s.resize(j-k);
                j--;
            }

           // s.push_back('h');

        }

        res.push_back(s);

    }
    for(int i = 0; i < n; i++)
    {
        ss.insert(res[i]);
    }
    cout << ss.size() << endl;

}


#include <bits/stdc++.h>
using namespace std;
vector <string> res;
set <string> ss;
int main()
{
    freopen("input.txt", "r", stdin);
  //  freopen("output.txt", "w", stdout);
    int n;
    cin >> n;
    for(int i = 1; i<=n; i++)
    {
        string d;
        cin >> d;
        int z = d.size();
        string s1 = "";
        for(int j = 0; j < z; j++)
        {
            if (d[j] == 'o'&& d[j+1]=='o')
            {
                s1.push_back('u');
                j++;
                //j++;
                //kk++;
                continue;
            }
            s1.push_back(d[j]);
        }
        cout <<s1<<endl;
        d = s1;
        z = d.size();
        int kk = 1;
        string s = "";
        for(int j = 0; j < z; j++)
        {
            if (d[j] != 'k')
            {
                s.push_back(d[j]);
                continue;
            }
            //j++;
           int k = 0;
            while(j <z  && d[j] == 'k')
            {
                s.push_back(d[j]);
                j++;
                k++;
            }
            if (d[j] != 'h')
            {
               // s.push_back('k');
               j--;
               continue;

            }
            else
            {
                s.resize(j-k);
                j--;
            }

           // s.push_back('h');

        }

        res.push_back(s);

    }
    for(int i = 0; i < n; i++)
    {
        ss.insert(res[i]);
    }
    cout << ss.size() << endl;

}


#include <bits/stdc++.h>
using namespace std;
vector <string> res;
set <string> ss;
int main()
{
//    freopen("input.txt", "r", stdin);
  //  freopen("output.txt", "w", stdout);
    int n;
    cin >> n;
    for(int i = 1; i<=n; i++)
    {
        string d;
        cin >> d;
        int z = d.size();
        string s1 = "";
        for(int j = 0; j < z; j++)
        {
            if (d[j] == 'o'&& d[j+1]=='o')
            {
                s1.push_back('u');
                j++;
                //j++;
                //kk++;
                continue;
            }
            s1.push_back(d[j]);
        }

        d = s1;
        z = d.size();
        int kk = 1;
        string s = "";
        for(int j = 0; j < z; j++)
        {
            if (d[j] != 'k')
            {
                s.push_back(d[j]);
                continue;
            }
            //j++;
           int k = 0;
            while(j <z  && d[j] == 'k')
            {
                s.push_back(d[j]);
                j++;
                k++;
            }
            if (d[j] != 'h')
            {
               // s.push_back('k');
               j--;
               continue;

            }
            else
            {
                s.resize(j-k);
                j--;
            }

           // s.push_back('h');

        }

        res.push_back(s);

    }
    for(int i = 0; i < n; i++)
    {
        ss.insert(res[i]);
    }
    cout << ss.size() << endl;

}


#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int n;
struct fuck
{
	string a;
}wtf[500];
int fa[500],tong[500];
int find(int x)
{
	if (fa[x] != x) fa[x] = find(fa[x]);
	return fa[x];
}
int main()
{
	scanf("%d",&n);
	for (int i=1;i<=n;i++)
	cin>>wtf[i].a;

	for (int i=1;i<=n;i++)
	{
		for (int j=0; j < wtf[i].a.length(); j++)
		{
			/*if (wtf[i].a[j] == 'h')
			{
				int head = j;
				while (wtf[i].a[head]=='k' && head>=0) head--;
				if (head==j)continue;
				wtf[i].a.erase(head,j-head+1);
			}*/
			if (wtf[i].a[j]=='u')
			{
				wtf[i].a[j] = 'o';
				wtf[i].a.insert(j,"o");
			}
		}
	}

	for (int i=1;i<=n;i++)
	{
		for (int j=wtf[i].a.length(); j >= 0; j--)
		{
			if (wtf[i].a[j] == 'h')
			{
				int head = j - 1;
				if (head < 0) continue;
				if (wtf[i].a[head] != 'k') continue;
				while (wtf[i].a[head - 1 ]=='k' && head >= 0) head--;
				wtf[i].a.erase(head,j-head);
			}
		}
	}
	for (int i=1;i<=n;i++) fa[i] = i;

	for (int i=1;i<=n;i++)
	for (int j=i+1;j<=n;j++)
	{
		if (wtf[i].a.length() == wtf[j].a.length())
		{
			bool check = true;
			for (int p=0;p<wtf[i].a.length();p++)
			if (wtf[i].a[p] != wtf[j].a[p] ) check = false;
			if (check)
			{
				int fi = find(i),fj = find(j);
				fa[fi] = fj;
			}
		}
	}

	memset(tong,0,sizeof tong);
	for (int i=1;i<=n;i++) tong[find(i)]++;
	int ans  =0;
	for (int i=1;i<=n;i++) if (tong[i]) ans++;

	//for (int i=1;i<=n;i++) cout<<fa[i]<<" ";
	//cout<<endl;
	//for (int i=1;i<=n;i++)
	//{
	//	cout<<wtf[i].a<<endl;
	//}
	cout<<ans;
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int n;
struct fuck
{
	string a;
}wtf[500];
int fa[500],tong[500];
int find(int x)
{
	if (fa[x] != x) fa[x] = find(fa[x]);
	return fa[x];
}
int main()
{
	scanf("%d",&n);
	for (int i=1;i<=n;i++)
	cin>>wtf[i].a;

	for (int i=1;i<=n;i++)
	{
		for (int j=0; j < wtf[i].a.length(); j++)
		{
			/*if (wtf[i].a[j] == 'h')
			{
				int head = j;
				while (wtf[i].a[head]=='k' && head>=0) head--;
				if (head==j)continue;
				wtf[i].a.erase(head,j-head+1);
			}*/
			if (wtf[i].a[j]=='o'&&wtf[i].a[j+1]=='o')
			{
				wtf[i].a.erase(j+1,1);
				wtf[i].a[j] = 'u';
			}
		}
	}

	for (int i=1;i<=n;i++)
	{
		for (int j=wtf[i].a.length(); j >= 0; j--)
		{
			if (wtf[i].a[j] == 'h')
			{
				int head = j - 1;
				if (wtf[i].a[head] != 'k') continue;
				while (wtf[i].a[head - 1 ]=='k' && head>=0) head--;
				wtf[i].a.erase(head,j-head);
			}
		}
	}
	for (int i=1;i<=n;i++) fa[i] = i;

	for (int i=1;i<=n;i++)
	for (int j=i+1;j<=n;j++)
	{
		if (wtf[i].a.length() == wtf[j].a.length())
		{
			bool check = true;
			for (int p=0;p<wtf[i].a.length();p++)
			if (wtf[i].a[p] != wtf[j].a[p] ) check = false;
			if (check)
			{
				int fi = find(i),fj = find(j);
				fa[fi] = fj;
			}
		}
	}

	memset(tong,0,sizeof tong);
	for (int i=1;i<=n;i++) tong[find(i)]++;
	int ans  =0;
	for (int i=1;i<=n;i++) if (tong[i]) ans++;

	//for (int i=1;i<=n;i++) cout<<tong[i]<<" ";
	//cout<<endl;
	//for (int i=1;i<=n;i++)
	//{
	//	cout<<wtf[i].a<<endl;
	//}
	cout<<ans;
	return 0;
}


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

set<string>set1;
int main()
{

    int n;scanf("%d",&n);
    //string sT[n];
    //for(int i=0;i<n;i++)cin>>sT[i];
    for(int i=0;i<n;i++){
        string s;cin>>s;
        string temp;
        for(int j=0;j<s.length();j++){
            if(s[j]=='u')temp+="oo";
            else temp+=s[j];
        }
        s=temp;
        temp="";
        for(int j=0;j<s.length();){
            if(s[j]=='k'){
                for(int j1=j;j1<s.length();j1++){
                    if(s[j1]=='k'){
                        if(j1==s.length()-1){
                            for(int k=j;k<s.length();k++){
                                temp+=s[k];
                            }
                            j=j1+1;
                            break;
                        }
                    }
                    else if(s[j1]=='h'){
                        j=j1;
                        break;
                    }
                    else{
                        for(int k=j;k<j1;k++){
                            temp+=s[k];
                        }
                        j=j1;
                        break;
                    }
                }
            }
            else{
                temp+=s[j++];
            }
        }
        set1.insert(temp);
    }
    cout<<set1.size();

}


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

set<string>set1;
int main()
{

    int n;scanf("%d",&n);

    for(int i=0;i<n;i++){
        string s;cin>>s;
        string temp;
        for(int j=0;j<s.length();j++){
            if(s[j]=='u')temp+="oo";
            else temp+=s[j];
        }
        s=temp;
        temp="";
        for(int j=0;j<s.length();){
            if(s[j]=='k'){
                for(int j1=j+1;j1<s.length();j1++){
                    if(s[j1]=='k');
                    else if(s[j1]=='h'){
                        j=j1;
                        break;
                    }
                    else{
                        for(int k=j;k<j1;k++){
                            temp+=s[k];
                        }
                        j=j1;
                        break;
                    }
                }
            }
            else{
                temp+=s[j++];
            }
        }
        set1.insert(temp);
    }
    cout<<set1.size();

}


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

set<string>set1;
int main()
{

    int n;scanf("%d",&n);
    string sT[n];
    for(int i=0;i<n;i++)cin>>sT[i];
    for(int i=0;i<n;i++){
        string s=sT[i];
        string temp;
        for(int j=0;j<s.length();j++){
            if(s[j]=='u')temp+="oo";
            else temp+=s[j];
        }
        s=temp;
        temp="";
        for(int j=0;j<s.length();){
            if(s[j]=='k'){
                for(int j1=j+1;j1<s.length();j1++){
                    if(s[j1]=='k'){
                        if(j1==s.length()-1){
                            for(int k=j;k<s.length();k++){
                                temp+=s[k];
                            }
                            j=j1+1;
                            break;
                        }
                    }
                    else if(s[j1]=='h'){
                        j=j1;
                        break;
                    }
                    else{
                        for(int k=j;k<j1;k++){
                            temp+=s[k];
                        }
                        j=j1;
                        break;
                    }
                }
            }
            else{
                temp+=s[j++];
            }
        }
        set1.insert(temp);
    }
    cout<<set1.size();

}


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

set<string>set1;
int main()
{

    int n;scanf("%d",&n);
    string sT[n];
    for(int i=0;i<n;i++)cin>>sT[i];
    for(int i=0;i<n;i++){
        string s=sT[i];
        string temp;
        for(int j=0;j<s.length();j++){
            if(s[j]=='u')temp+="oo";
            else temp+=s[j];
        }
        s=temp;
        temp="";
        for(int j=0;j<s.length();){
            if(s[j]=='k'){
                for(int j1=j+1;j1<s.length();j1++){
                    if(s[j1]=='k');
                    else if(s[j1]=='h'){
                        j=j1;
                        break;
                    }
                    else{
                        for(int k=j;k<j1;k++){
                            temp+=s[k];
                        }
                        j=j1;
                        break;
                    }
                }
            }
            else{
                temp+=s[j++];
            }
        }
        set1.insert(temp);
    }
    cout<<set1.size();

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long n,i,len,k,j,count=0,len1;
	char name[405][26],tarr[26],tarr1[26];
	vector< vector<char > >new_name;
	vector < char > tem_name;
	cin >> n;
	for(i=0;i<n;i++)
	{
		cin >> name[i];
	}

	for(i=0;i<n;i++)
	{
		tem_name.clear();
		len=strlen(name[i]);
		k=0;
		for(j=0;j<len-1;j++)
		{
			if(name[i][j]=='u')
			{
				tem_name.push_back('o');
				tem_name.push_back('o');
			}
			else if(name[i][j]=='k' && name[i][j+1]=='h')
			{
				//	tem.push_back(k);
				len1=tem_name.size();
				for(k=len1-1;k>=0;k--)
				{
					if(tem_name[k]!='k')
					{
						tem_name.erase(tem_name.begin()+k+1,tem_name.end());
						break;
					}

				}
				if(k==-1)
					tem_name.clear();
				//				tem_name.push_back('h');
				//	j++;
			}
			else
			{

				tem_name.push_back(name[i][j]);
			}
		}
		if(j!=len)
		{
			if(name[i][len-1]=='u')
			{
				tem_name.push_back('o');
				tem_name.push_back('o');
			}
			else
				tem_name.push_back(name[i][len-1]);
		}
		new_name.push_back(tem_name);
	}
	sort(new_name.begin(),new_name.end());
	for(i=0;i<n-1;i++)
	{
		j=0;
		for(vector <char> :: iterator it=new_name[i].begin();it!=new_name[i].end();++it)
		{
			tarr[j++]=*it;
		}
		tarr[j]='\0';
		j=0;
		for(vector <char> :: iterator it=new_name[i+1].begin();it!=new_name[i+1].end();++it)
		{
			tarr1[j++]=*it;
		}
		tarr1[j]='\0';
//		cout << tarr << endl;
		if(strcmp(tarr,tarr1)==0)
			count++;
	}
//	cout << tarr1 << endl;
	cout << n-count << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long n,i,len,k,j,count=0,len1;
	char name[405][45],tarr[45],tarr1[45];
	vector< vector<char > >new_name;
	vector < char > tem_name;
	cin >> n;
	for(i=0;i<n;i++)
	{
		cin >> name[i];
	}

	for(i=0;i<n;i++)
	{
		tem_name.clear();
		len=strlen(name[i]);
		k=0;
		for(j=0;j<len-1;j++)
		{
			if(name[i][j]=='u')
			{
				tem_name.push_back('o');
				tem_name.push_back('o');
			}
			else if(name[i][j]=='k' && name[i][j+1]=='h')
			{
				//	tem.push_back(k);
				len1=tem_name.size();
				for(k=len1-1;k>=0;k--)
				{
					if(tem_name[k]!='k')
					{
						tem_name.erase(tem_name.begin()+k+1,tem_name.end());
						break;
					}

				}
				if(k==-1)
					tem_name.clear();
				//				tem_name.push_back('h');
				//	j++;
			}
			else
			{

				tem_name.push_back(name[i][j]);
			}
		}
		if(j!=len)
		{
			if(name[i][len-1]=='u')
			{
				tem_name.push_back('o');
				tem_name.push_back('o');
			}
			else
				tem_name.push_back(name[i][len-1]);
		}
		new_name.push_back(tem_name);
	}
	sort(new_name.begin(),new_name.end());
	for(i=0;i<n-1;i++)
	{
		j=0;
		for(vector <char> :: iterator it=new_name[i].begin();it!=new_name[i].end();++it)
		{
			tarr[j++]=*it;
		}
		tarr[j]='\0';
		j=0;
		for(vector <char> :: iterator it=new_name[i+1].begin();it!=new_name[i+1].end();++it)
		{
			tarr1[j++]=*it;
		}
		tarr1[j]='\0';
//		cout << tarr << endl;
		if(strcmp(tarr,tarr1)==0)
			count++;
	}
//	cout << tarr1 << endl;
	cout << n-count << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long n,i,len,k,j,count=0,len1;
	char name[405][26],tarr[26],tarr1[26];
	vector< vector<char > >new_name;
	vector < char > tem_name;
	cin >> n;
	for(i=0;i<n;i++)
	{
		cin >> name[i];
	}

	for(i=0;i<n;i++)
	{
		tem_name.clear();
		len=strlen(name[i]);
		k=0;
		for(j=0;j<len-1;j++)
		{
			if(name[i][j]=='u')
			{
				tem_name.push_back('o');
				tem_name.push_back('o');
			}
			else if(name[i][j]=='k' && name[i][j+1]=='h')
			{
			//	tem.push_back(k);
				len1=tem_name.size();
				for(k=len1-1;k>=0;k--)
				{
					if(tem_name[k]!='k')
					{
						tem_name.erase(tem_name.begin()+k+1,tem_name.end());
						break;
					}

				}
				if(k==-1)
					tem_name.clear();
				//				tem_name.push_back('h');
			//	j++;
			}
			else
			{
				tem_name.push_back(name[i][j]);
			}
		}
		if(j!=len)
		{
			tem_name.push_back(name[i][len-1]);
		}
		new_name.push_back(tem_name);
	}
	sort(new_name.begin(),new_name.end());
	for(i=0;i<n-1;i++)
	{
		j=0;
		for(vector <char> :: iterator it=new_name[i].begin();it!=new_name[i].end();++it)
		{
			tarr[j++]=*it;
		}
		tarr[j]='\0';
		j=0;
		for(vector <char> :: iterator it=new_name[i+1].begin();it!=new_name[i+1].end();++it)
		{
			tarr1[j++]=*it;
		}
		tarr1[j]='\0';
//		cout << tarr << endl;
		if(strcmp(tarr,tarr1)==0)
			count++;
	}
//	cout << tarr1 << endl;
	cout << n-count << endl;
	return 0;
}


#include <bits/stdc++.h>

#define REP(i, a) for(int i = 0; i < a; i++)
#define RFOR(i,x,y) for(int i = x; i>= y; i--)
#define FOR(i,x,y) for (int i = x; i < y; i++)
#define ITFOR(it,A) for(typeof A.begin() it = A.begin(); it!=A.end(); it++)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define VE vector <int>
#define mset(A,x) memset(A, x, sizeof A)
#define PB push_back
#define ones(x) __builtin_popcount(x)
#define cua(x) (x)*(x)
#define debug(x) cout <<#x << " = " << x << endl
#define adebug(x,n) cout <<#x<<endl; REP(i,n)cout<<x[i]<<char(i+1==n?10:32)
#define mdebug(x,m,n) cout <<#x<<endl; REP(i,m)REP(j,n)cout<<x[i][j]<<char(j+1==n?10:32)
#define LSOne(S) (S&(-S))

using namespace std;

#define ll long long
#define lli long long int
#define PI acos(-1.0)
#define ii pair<int,int>
#define inf_ll (((1LL<<62)-1)<<1)+1
#define inf_i (1<<30)-1

string tranf(string first){
	string cad1="";
	for(int i=first.size()-1; i>=0; i--){
		//if(first[i]=='o'&&(i-1>=0&&first[i-1]=='o')) cad1='u'+cad1, i--;
		if(first[i]=='u') cad1="oo"+cad1;
		else if(first[i]=='h'&&(i-1>=0&&first[i-1]=='k')){
			cad1='h'+cad1;
			while(i-1>=0&&first[i-1]=='k') i--;
		}
		else cad1=first[i]+cad1;
	}
	return cad1;
}

int main(){
/*
freopen("input.txt", "r", stdin);
freopen("out.txt", "w", stdout);
*/
	vector< pair<string,bool> >arreglo;
	set<string> sol;
	int n,cnt=0; scanf("%d",&n);
	string cad;
	REP(i,n){
		cin>>cad;
		sol.insert(tranf(cad));
	}
	printf("%d\n",(int)sol.size());

/*
fclose(stdin);
fclose(stdout);
*/

  return 0;
}


#include <bits/stdc++.h>

#define REP(i, a) for(int i = 0; i < a; i++)
#define RFOR(i,x,y) for(int i = x; i>= y; i--)
#define FOR(i,x,y) for (int i = x; i < y; i++)
#define ITFOR(it,A) for(typeof A.begin() it = A.begin(); it!=A.end(); it++)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define VE vector <int>
#define mset(A,x) memset(A, x, sizeof A)
#define PB push_back
#define ones(x) __builtin_popcount(x)
#define cua(x) (x)*(x)
#define debug(x) cout <<#x << " = " << x << endl
#define adebug(x,n) cout <<#x<<endl; REP(i,n)cout<<x[i]<<char(i+1==n?10:32)
#define mdebug(x,m,n) cout <<#x<<endl; REP(i,m)REP(j,n)cout<<x[i][j]<<char(j+1==n?10:32)
#define LSOne(S) (S&(-S))

using namespace std;

#define ll long long
#define lli long long int
#define PI acos(-1.0)
#define ii pair<int,int>
#define inf_ll (((1LL<<62)-1)<<1)+1
#define inf_i (1<<30)-1

string tranf(string first){
	string cad1="";
	for(int i=first.size()-1; i>=0; i--){
		//if(first[i]=='o'&&(i-1>=0&&first[i-1]=='o')) cad1='u'+cad1, i--;
		if(first[i]=='u') cad1="oo"+cad1;
		else if(first[i]=='h'&&(i-1>=0&&first[i-1]=='k')){
			cad1='h'+cad1;
			while(i-1>=0&&first[i-1]=='k') i--;
		}
		else cad1=first[i]+cad1;
	}
	return cad1;
}

int main(){
	vector< pair<string,bool> >arreglo;
	set<string> sol;
	int n,cnt=0; scanf("%d",&n);
	string cad;
	REP(i,n){
		cin>>cad;
		sol.insert(tranf(cad));
	}
	printf("%d\n",(int)sol.size());
  return 0;
}


#include<iostream>
#include<cstring>
#include<set>
using namespace std;
int main()
{
    int n,sum=0;
    string s[410];
    char temp[30],temp_1[30];
    cin>>n;
    set<string>st;
    for(int i=0;i<n;++i)
    {
        scanf("%s",temp);
        string temp_2;
        int k=0;
        for(int j=strlen(temp)-1;j>=0;--j)
        {
            if(temp[j]=='h')
            {
                temp_1[k++]=temp[j];
                while(temp[j-1]=='k')
                {
                    --j;
                }
            }
            else
            {
                temp_1[k++]=temp[j];
            }
        }
        int z=0;
        for(int j=k-1;j>=0;--j)
        {
            if(temp_1[j]=='u')
            {
                temp[z++]='o';
                temp[z++]='o';
            }
            else
            temp[z++]=temp_1[j];
        }
        for(int j=0;j<z;++j)
        {
            temp_2+=temp[j];
        }
        st.insert(temp_2);
    }

    cout<<st.size()<<endl;
    return 0;

}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<set>
using namespace std;
int main()
{
    int n,sum=0;
    string s[410];
    char temp[30],temp_1[30];
    cin>>n;
    set<string>st;
    for(int i=0;i<n;++i)
    {
        scanf("%s",temp);
        string temp_2;
        int k=0;
        for(int j=strlen(temp)-1;j>=0;--j)
        {
            if(temp[j]=='h')
            {
                temp_1[k++]=temp[j];
                while(temp[j-1]=='k')
                {
                    --j;
                }
            }
            else
            {
                temp_1[k++]=temp[j];
            }
        }
        int z=0;
        for(int j=k-1;j>=0;--j)
        {
            if(temp_1[j]=='u')
            {
                temp[z++]='o';
                temp[z++]='o';
            }
            else
            temp[z++]=temp_1[j];
        }
        for(int j=0;j<z;++j)
        {
            temp_2+=temp[j];
        }
        st.insert(temp_2);
    }

    cout<<st.size()<<endl;
    return 0;

}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<set>
using namespace std;
int main()
{
    int n,sum=0;
    string s[410];
    char temp[30],temp_1[30];
    cin>>n;
    set<string>st;
    for(int i=0;i<n;++i)
    {
        scanf("%s",temp);
        string temp_2;
        int k=0;
        for(int j=strlen(temp)-1;j>=0;--j)
        {
            if(temp[j]=='h')
            {
                temp_1[k++]=temp[j];
                while(temp[j-1]=='k'&&j>=0)
                {
                    --j;
                }
            }
            else
            {
                temp_1[k++]=temp[j];
            }
        }
        int z=0;
        for(int j=k-1;j>=0;--j)
        {
            if(temp_1[j]=='u')
            {
                temp[z++]='o';
                temp[z++]='o';
            }
            else
            temp[z++]=temp_1[j];
        }
        for(int j=0;j<z;++j)
        {
            temp_2+=temp[j];
        }
        st.insert(temp_2);
    }

    cout<<st.size()<<endl;
    return 0;

}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<set>
using namespace std;
int main()
{
    int n,sum=0;
    string s[410];
    char temp[50],temp_1[50];
    cin>>n;
    set<string>st;
    for(int i=0;i<n;++i)
    {
        scanf("%s",temp);
        string temp_2;
        int k=0;
        for(int j=strlen(temp)-1;j>=0;--j)
        {
            if(temp[j]=='h')
            {
                temp_1[k++]=temp[j];
                while(temp[j-1]=='k'&&j>=0)
                {
                    --j;
                }
            }
            else
            {
                temp_1[k++]=temp[j];
            }
        }
        int z=0;
        for(int j=k-1;j>=0;--j)
        {
            if(temp_1[j]=='u')
            {
                temp[z++]='o';
                temp[z++]='o';
            }
            else
            temp[z++]=temp_1[j];
        }
        for(int j=0;j<z;++j)
        {
            temp_2+=temp[j];
        }
        st.insert(temp_2);
    }

    cout<<st.size()<<endl;
    return 0;

}


#include<iostream>
#include<cstring>
#include<set>
using namespace std;
int main()
{
    int n,sum=0;
    string s[410];
    char temp[30],temp_1[30];
    cin>>n;
    set<string>st;
    for(int i=0;i<n;++i)
    {
        cin>>temp;
        string temp_2;
        int k=0;
        for(int j=strlen(temp)-1;j>=0;--j)
        {
            if(temp[j]=='h')
            {
                temp_1[k++]=temp[j];
                while(temp[j-1]=='k')
                {
                    --j;
                }
            }
            else
            {
                temp_1[k++]=temp[j];
            }
        }
        int z=0;
        for(int j=k-1;j>=0;--j)
        {
            if(temp_1[j]=='u')
            {
                temp[z++]='o';
                temp[z++]='o';
            }
            else
            temp[z++]=temp_1[j];
        }
        for(int j=0;j<z;++j)
        {
            temp_2+=temp[j];
        }
        st.insert(temp_2);
    }

    cout<<st.size()<<endl;
    return 0;

}


/*
 * test.cpp
 *
 *
 *      Author: Fireworks
 */

#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<queue>
#include<string>
#include<map>
#include<cmath>
#include<bitset>
#include<set>
#include<iomanip>
#include<fstream>
#include<bitset>
#include<cstring>
#include<cstdlib>
#include<complex>
#include<list>
#include<sstream>
#include<cassert>   // assert

using namespace std;

//#define double long double

typedef pair<int,int> ii;
typedef pair<int,long long> il;
typedef pair<long long,long long> ll;
typedef pair<ll,int> lli;
typedef pair<long long,int> li;
typedef pair<double,double> dd;
typedef pair<ii,int> iii;
typedef pair<double,int> di;
long long mod = 1000000007LL;
long long base = 10000007;
long long large = 1000000000000000000LL;

int main(){
	set<string> s;
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		string t;
		cin>>t;
		reverse(t.begin(),t.end());
		string temp = "";
		for(int i=0;i<(int)t.length();i++){
			if(temp.length()>0&&temp[temp.length()-1]=='h'){
				if(t[i]=='k') continue;
			}
			temp.push_back(t[i]);
		}
		t = temp;
		reverse(t.begin(),t.end());
		temp = "";
		int l = (int)t.length();
		for(int i=0;i<l;i++){
			if(t[i]=='u'){
				temp = temp+"oo";
				continue;
			}
			temp.push_back(t[i]);
		}
		t = temp;
		s.insert(t);
	}
	cout<<(int)s.size()<<endl;

	return 0;

}


#include<string>
#include<iostream>
#include<set>
using namespace std;
int main()
{
	set<string> myset;
	int n;
	cin>>n;
	string s;
	string::size_type pos;
	while(n--)
	{
		cin>>s;
		while((pos=s.find("oo"))!=string::npos)
		{
			s=s.substr(0,pos)+'u'+s.substr(pos+2);
		}
		while((pos=s.find("kh"))!=string::npos)
		{
			s.erase(pos,1);
		}
		myset.insert(s);
	}
	cout<<myset.size()<<endl;
	return 0;
}


#include<string>
#include<iostream>
#include<set>
using namespace std;
int main()
{
	set<string> myset;
	int n;
	cin>>n;
	string s;
	string::size_type pos;
	while(n--)
	{
		cin>>s;
		while((pos=s.find("u"))!=string::npos)
		{
			s=s.substr(0,pos)+"oo"+s.substr(pos+1);
		}
		while((pos=s.find("kh"))!=string::npos)
		{
			s.erase(pos,1);
		}
		myset.insert(s);
	}
	cout<<myset.size()<<endl;
	return 0;
}


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

set<string> name;

int main()
{
	//freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
	ios::sync_with_stdio(0);
	cin.tie(0);

	int n; cin >> n;
	for (int i = 0; i < n; i++){
		string s; cin >> s;
		string foo;
		for (int i = 0; i < (int)s.size(); i++){
			if (s[i] == 'u') foo.push_back('o'), foo.push_back('o');
			else foo.push_back(s[i]);
		}
		s = foo;
		foo = "";
		int k = 0;
		for (int i = 0; i < s.size(); i++){
			if (s[i] == 'k'){
				k++;
				continue;
			}
			if (k == 0) foo.push_back(s[i]);
			else if (s[i] == 'h') foo.push_back('h'), k = 0;
			else{
				while (k--) foo.push_back('k');
				k = 0;
				foo.push_back(s[i]);
			}
		}
		while (k--) foo.push_back('k');
		name.insert(foo);
	}
	cout << name.size() << endl;

	return 0;
}


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

set<string> name;

int main()
{
	//freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
	ios::sync_with_stdio(0);
	cin.tie(0);

	int n; cin >> n;
	for (int i = 0; i < n; i++){
		string s; cin >> s;
		string foo;
		for (int i = 0; i < (int)s.size(); i++){
			if (s[i] == 'u') foo.push_back('o'), foo.push_back('o');
			else foo.push_back(s[i]);
		}
		s = foo;
		foo = "";
		int k = 0;
		for (int i = 0; i < s.size(); i++){
			if (s[i] == 'k'){
				k++;
				continue;
			}
			if (k == 0) foo.push_back(s[i]);
			else if (s[i] == 'h') foo.push_back('h'), k = 0;
			else{
				while (k--) foo.push_back('k');
				k = 0;
				foo.push_back(s[i]);
			}
		}
		name.insert(foo);
	}
	cout << name.size() << endl;

	return 0;
}


//Copyright(c)2017 Mstdream
#include<bits/stdc++.h>
using namespace std;

inline void splay(int &v){
	v=0;char c=0;int p=1;
	while(c<'0' || c>'9'){if(c=='-')p=-1;c=getchar();}
	while(c>='0' && c<='9'){v=(v<<3)+(v<<1)+c-'0';c=getchar();}
	v*=p;
}
map<string,int>ls;
char s[200010],t[200010];
int n,cnt;
int main(){
	splay(n);
	for(int i=1;i<=n;i++){
		scanf("%s",s+1);
		int m=strlen(s+1);
		int tp=0;cnt=0;
		for(int j=m;j>=1;j--){
			if(s[j]=='u'){
				t[++cnt]='o',t[++cnt]='o';
				tp=0;
			}
			else if(s[j]=='h')tp=1,t[++cnt]='h';
			else if(s[j]=='k'&&tp==1)continue;
			else t[++cnt]=s[j],tp=0;
		}
		t[cnt+1]=0;
		ls[t+1]=1;
	}
	cout<<ls.size()<<endl;
}


//Copyright(c)2017 Mstdream
#include<bits/stdc++.h>
using namespace std;

inline void splay(int &v){
	v=0;char c=0;int p=1;
	while(c<'0' || c>'9'){if(c=='-')p=-1;c=getchar();}
	while(c>='0' && c<='9'){v=(v<<3)+(v<<1)+c-'0';c=getchar();}
	v*=p;
}
map<string,int>ls;
char s[200010],t[200010];
int n,cnt;
int main(){
	splay(n);
	for(int i=1;i<=n;i++){
		scanf("%s",s+1);
		int m=strlen(s+1);
		int tp=0;cnt=0;
		for(int j=m;j>=1;j--){
			if(s[j]=='u'){
				t[++cnt]='o',t[++cnt]='o';
			}
			else if(s[j]=='h')tp=1,t[++cnt]='h';
			else if(s[j]=='k'&&tp==1)continue;
			else t[++cnt]=s[j],tp=0;
		}
		t[cnt+1]=0;
		ls[t+1]=1;
	}
	cout<<ls.size()<<endl;
	//for(map<string,int>::iterator it=ls.begin();it!=ls.end();++it){
	//	cerr<<it->first<<endl;
	//}
}


import java.util.*;

//Petya and Staircases

public class CF_212_II_B {

	boolean[] stair;
	//int[] can;
	int[] dirtyIndex;

	void setup(int[] count,int[] dirty) {
		this.stair = new boolean[count[0]+1];
		//this.can = new int[count[0]+1];
		for(int i=0;i<stair.length;i++) {
			stair[i] = true;
			//can[i] = -1;
		}
		for(int i=0;i<dirty.length;i++) this.stair[dirty[i]] = false;
	}

	boolean canGoFromLevel(int level) {

		if(this.stair[level]==false || this.stair[this.stair.length-1]==false) return false;
		else {
			for(int i=level+1;i<this.stair.length-3;i++) {
				if(stair[i]==false&&stair[i+1]==false&&stair[i+2]==false) return false;
			}
		}
		return true;
		/*
		//if(level>this.stair.length-1) return true;
		if(level<this.stair.length) {
			if(can[level]==0) return false;
			if(can[level]==1) return true;
			if(this.stair[level]==false) return false;
		}
		//else {
			boolean flag = false;
			if(this.stair.length-level==3) {
				flag = this.canGoFromLevel(level+1) || this.canGoFromLevel(level+2);
			} else if(this.stair.length-level==2) {
				flag = this.canGoFromLevel(level+1);
			} else if(this.stair.length-level==1) {
				flag = this.stair[level];
			} else {
				flag = this.canGoFromLevel(level+1)||
						this.canGoFromLevel(level+2)||this.canGoFromLevel(level+3);
			}
			if(flag==true) can[level] = 1;
			else can[level] = 0;
			return flag;
		//}
		 */
	}

	boolean isDirty(int index) {
		int flag = Arrays.binarySearch(this.dirtyIndex, index);
		if(flag<0) return false;
		else return true;
	}

	public static void main(String[] args) {
		/*
		CF_212_II_B test = new CF_212_II_B();
		int[] count = {5,2};
		int[] dirty = {4,5};
		test.setup(count, dirty);
		System.out.println(test.canGoFromLevel(1));
		System.out.println(Arrays.toString(test.stair));
		*/
		//int total = 1000000000;
		CF_212_II_B test = new CF_212_II_B();
		Scanner in = new Scanner(System.in);
		int totalNum = in.nextInt();
		int dirtyNum = in.nextInt();
		test.dirtyIndex = new int[dirtyNum];
		for(int i=0;i<test.dirtyIndex.length;i++) {
			test.dirtyIndex[i] = in.nextInt();
		}
		in.close();
		Arrays.sort(test.dirtyIndex);
		if(test.dirtyIndex.length==0) {
			System.out.println("YES");
			return;
		}
		if(test.dirtyIndex[0]==1 || test.dirtyIndex[dirtyNum-1]==totalNum) {
			System.out.println("NO");
			return;
		}
		if(test.dirtyIndex.length<3) {
			System.out.println("YES");
			return;
		} else {
			for(int i=0;i<test.dirtyIndex.length-2;i++) {
				if(test.dirtyIndex[i]-test.dirtyIndex[i+1]==-1 &&
						test.dirtyIndex[i+1]-test.dirtyIndex[i+2]==-1) {
					System.out.println("NO");
					return;
				}
			}
			//System.out.println(Arrays.toString(test.dirtyIndex));
			System.out.println("YES");
		}

		/*
		if(test.isDirty(1) || test.isDirty(totalNum)) {
			System.out.println("NO");
			in.close();
			return;
		} else {
			boolean flag1 = test.isDirty(2);
			boolean flag2 = test.isDirty(3);
			for(int i=4;i<totalNum-3;i++) {
				boolean flag3 = test.isDirty(i);
				if(flag1&&flag2&&flag3) {
					System.out.println("NO");
					in.close();
					return;
				} else {
					flag1 = flag2;
					flag2 = flag3;
				}
			}
		}
		System.out.println("YES");
		in.close();
		return;
		*/
	}

}


import java.util.*;

//Petya and Staircases

public class CF_212_II_B {

	boolean[] stair;
	//int[] can;

	void setup(int[] count,int[] dirty) {
		this.stair = new boolean[count[0]+1];
		//this.can = new int[count[0]+1];
		for(int i=0;i<stair.length;i++) {
			stair[i] = true;
			//can[i] = -1;
		}
		for(int i=0;i<dirty.length;i++) this.stair[dirty[i]] = false;
	}

	boolean canGoFromLevel(int level) {

		if(this.stair[level]==false || this.stair[this.stair.length-1]==false) return false;
		else {
			for(int i=level+1;i<this.stair.length-3;i++) {
				if(stair[i]==false&&stair[i+1]==false&&stair[i+2]==false) return false;
			}
		}
		return true;
		/*
		//if(level>this.stair.length-1) return true;
		if(level<this.stair.length) {
			if(can[level]==0) return false;
			if(can[level]==1) return true;
			if(this.stair[level]==false) return false;
		}
		//else {
			boolean flag = false;
			if(this.stair.length-level==3) {
				flag = this.canGoFromLevel(level+1) || this.canGoFromLevel(level+2);
			} else if(this.stair.length-level==2) {
				flag = this.canGoFromLevel(level+1);
			} else if(this.stair.length-level==1) {
				flag = this.stair[level];
			} else {
				flag = this.canGoFromLevel(level+1)||
						this.canGoFromLevel(level+2)||this.canGoFromLevel(level+3);
			}
			if(flag==true) can[level] = 1;
			else can[level] = 0;
			return flag;
		//}
		 */
	}

	public static void main(String[] args) {
		/*
		CF_212_II_B test = new CF_212_II_B();
		int[] count = {5,2};
		int[] dirty = {4,5};
		test.setup(count, dirty);
		System.out.println(test.canGoFromLevel(1));
		System.out.println(Arrays.toString(test.stair));
		*/

		Scanner in = new Scanner(System.in);
		int totalNum = in.nextInt();
		int dirtyNum = in.nextInt();
		int[] count = new int[2];
		count[0] = totalNum;
		count[1] = dirtyNum;
		int[] dirty = new int[dirtyNum];
		for(int i=0;i<dirtyNum;i++) {
			dirty[i] = in.nextInt();
		}
		CF_212_II_B test = new CF_212_II_B();
		test.setup(count, dirty);
		if(test.canGoFromLevel(1)) System.out.println("YES");
		else System.out.println("NO");
		in.close();

	}

}


import java.util.*;

//Petya and Staircases

public class CF_212_II_B {

	boolean[] stair;
	//int[] can;
	int[] dirtyIndex;

	void setup(int[] count,int[] dirty) {
		this.stair = new boolean[count[0]+1];
		//this.can = new int[count[0]+1];
		for(int i=0;i<stair.length;i++) {
			stair[i] = true;
			//can[i] = -1;
		}
		for(int i=0;i<dirty.length;i++) this.stair[dirty[i]] = false;
	}

	boolean canGoFromLevel(int level) {

		if(this.stair[level]==false || this.stair[this.stair.length-1]==false) return false;
		else {
			for(int i=level+1;i<this.stair.length-3;i++) {
				if(stair[i]==false&&stair[i+1]==false&&stair[i+2]==false) return false;
			}
		}
		return true;
		/*
		//if(level>this.stair.length-1) return true;
		if(level<this.stair.length) {
			if(can[level]==0) return false;
			if(can[level]==1) return true;
			if(this.stair[level]==false) return false;
		}
		//else {
			boolean flag = false;
			if(this.stair.length-level==3) {
				flag = this.canGoFromLevel(level+1) || this.canGoFromLevel(level+2);
			} else if(this.stair.length-level==2) {
				flag = this.canGoFromLevel(level+1);
			} else if(this.stair.length-level==1) {
				flag = this.stair[level];
			} else {
				flag = this.canGoFromLevel(level+1)||
						this.canGoFromLevel(level+2)||this.canGoFromLevel(level+3);
			}
			if(flag==true) can[level] = 1;
			else can[level] = 0;
			return flag;
		//}
		 */
	}

	boolean isDirty(int index) {
		int flag = Arrays.binarySearch(this.dirtyIndex, index);
		if(flag<0) return false;
		else return true;
	}

	public static void main(String[] args) {
		/*
		CF_212_II_B test = new CF_212_II_B();
		int[] count = {5,2};
		int[] dirty = {4,5};
		test.setup(count, dirty);
		System.out.println(test.canGoFromLevel(1));
		System.out.println(Arrays.toString(test.stair));
		*/
		CF_212_II_B test = new CF_212_II_B();
		Scanner in = new Scanner(System.in);
		int totalNum = in.nextInt();
		int dirtyNum = in.nextInt();
		test.dirtyIndex = new int[dirtyNum];
		for(int i=0;i<test.dirtyIndex.length;i++) {
			test.dirtyIndex[i] = in.nextInt();
		}
		Arrays.sort(test.dirtyIndex);
		if(test.isDirty(1) || test.isDirty(totalNum)) {
			System.out.println("NO");
			in.close();
			return;
		} else {
			for(int i=2;i<totalNum-3;i++) {
				if(test.isDirty(i)&&test.isDirty(i+1)&&test.isDirty(i+2)) {
					System.out.println("NO");
					in.close();
					return;
				}
			}
		}
		System.out.println("YES");
		in.close();
		return;
	}

}


import java.util.*;

//Petya and Staircases

public class CF_212_II_B {

	boolean[] stair;
	//int[] can;
	int[] dirtyIndex;

	void setup(int[] count,int[] dirty) {
		this.stair = new boolean[count[0]+1];
		//this.can = new int[count[0]+1];
		for(int i=0;i<stair.length;i++) {
			stair[i] = true;
			//can[i] = -1;
		}
		for(int i=0;i<dirty.length;i++) this.stair[dirty[i]] = false;
	}

	boolean canGoFromLevel(int level) {

		if(this.stair[level]==false || this.stair[this.stair.length-1]==false) return false;
		else {
			for(int i=level+1;i<this.stair.length-3;i++) {
				if(stair[i]==false&&stair[i+1]==false&&stair[i+2]==false) return false;
			}
		}
		return true;
		/*
		//if(level>this.stair.length-1) return true;
		if(level<this.stair.length) {
			if(can[level]==0) return false;
			if(can[level]==1) return true;
			if(this.stair[level]==false) return false;
		}
		//else {
			boolean flag = false;
			if(this.stair.length-level==3) {
				flag = this.canGoFromLevel(level+1) || this.canGoFromLevel(level+2);
			} else if(this.stair.length-level==2) {
				flag = this.canGoFromLevel(level+1);
			} else if(this.stair.length-level==1) {
				flag = this.stair[level];
			} else {
				flag = this.canGoFromLevel(level+1)||
						this.canGoFromLevel(level+2)||this.canGoFromLevel(level+3);
			}
			if(flag==true) can[level] = 1;
			else can[level] = 0;
			return flag;
		//}
		 */
	}

	boolean isDirty(int index) {
		int flag = Arrays.binarySearch(this.dirtyIndex, index);
		if(flag<0) return false;
		else return true;
	}

	public static void main(String[] args) {
		/*
		CF_212_II_B test = new CF_212_II_B();
		int[] count = {5,2};
		int[] dirty = {4,5};
		test.setup(count, dirty);
		System.out.println(test.canGoFromLevel(1));
		System.out.println(Arrays.toString(test.stair));
		*/
		CF_212_II_B test = new CF_212_II_B();
		Scanner in = new Scanner(System.in);
		int totalNum = in.nextInt();
		int dirtyNum = in.nextInt();
		test.dirtyIndex = new int[dirtyNum];
		for(int i=0;i<test.dirtyIndex.length;i++) {
			test.dirtyIndex[i] = in.nextInt();
		}
		Arrays.sort(test.dirtyIndex);
		if(test.isDirty(1) || test.isDirty(totalNum)) {
			System.out.println("NO");
			in.close();
			return;
		} else {
			boolean flag1 = test.isDirty(2);
			boolean flag2 = test.isDirty(3);
			for(int i=4;i<totalNum-3;i++) {
				boolean flag3 = test.isDirty(i);
				if(flag1&&flag2&&flag3) {
					System.out.println("NO");
					in.close();
					return;
				} else {
					flag1 = flag2;
					flag2 = flag3;
				}
			}
		}
		System.out.println("YES");
		in.close();
		return;
	}

}


import java.util.*;
import java.util.Arrays;

//Petya and Staircases

public class CF_212_II_B {

	boolean[] stair;
	int[] can;

	void setup(int[] count,int[] dirty) {
		this.stair = new boolean[count[0]+1];
		this.can = new int[count[0]+1];
		for(int i=0;i<stair.length;i++) {
			stair[i] = true;
			can[i] = -1;
		}
		for(int i=0;i<dirty.length;i++) this.stair[dirty[i]] = false;
	}

	boolean canGoFromLevel(int level) {
		if(level>this.stair.length-1) return true;
		if(can[level]==0) return false;
		if(can[level]==1) return true;
		if(this.stair[level]==false) return false;
		else {
			boolean flag = this.canGoFromLevel(level+1)||
					this.canGoFromLevel(level+2)||this.canGoFromLevel(level+3);
			if(flag==true) can[level] = 1;
			else can[level] = 0;
			return flag;
		}
	}

	public static void main(String[] args) {
		/*
		CF_212_II_B test = new CF_212_II_B();
		int[] count = {10, 5};
		int[] dirty = {2, 4, 8, 3, 6};
		test.setup(count, dirty);
		System.out.println(test.canGoFromLevel(1));
		System.out.println(Arrays.toString(test.stair));
		*/
		Scanner in = new Scanner(System.in);
		int totalNum = in.nextInt();
		int dirtyNum = in.nextInt();
		int[] count = new int[2];
		count[0] = totalNum;
		count[1] = dirtyNum;
		int[] dirty = new int[dirtyNum];
		for(int i=0;i<dirtyNum;i++) {
			dirty[i] = in.nextInt();
		}
		CF_212_II_B test = new CF_212_II_B();
		test.setup(count, dirty);
		if(test.canGoFromLevel(1)) System.out.println("YES");
		else System.out.println("NO");
		in.close();
	}

}


import java.util.*;

//Petya and Staircases

public class CF_212_II_B {

	boolean[] stair;
	//int[] can;
	int[] dirtyIndex;

	void setup(int[] count,int[] dirty) {
		this.stair = new boolean[count[0]+1];
		//this.can = new int[count[0]+1];
		for(int i=0;i<stair.length;i++) {
			stair[i] = true;
			//can[i] = -1;
		}
		for(int i=0;i<dirty.length;i++) this.stair[dirty[i]] = false;
	}

	boolean canGoFromLevel(int level) {

		if(this.stair[level]==false || this.stair[this.stair.length-1]==false) return false;
		else {
			for(int i=level+1;i<this.stair.length-3;i++) {
				if(stair[i]==false&&stair[i+1]==false&&stair[i+2]==false) return false;
			}
		}
		return true;
		/*
		//if(level>this.stair.length-1) return true;
		if(level<this.stair.length) {
			if(can[level]==0) return false;
			if(can[level]==1) return true;
			if(this.stair[level]==false) return false;
		}
		//else {
			boolean flag = false;
			if(this.stair.length-level==3) {
				flag = this.canGoFromLevel(level+1) || this.canGoFromLevel(level+2);
			} else if(this.stair.length-level==2) {
				flag = this.canGoFromLevel(level+1);
			} else if(this.stair.length-level==1) {
				flag = this.stair[level];
			} else {
				flag = this.canGoFromLevel(level+1)||
						this.canGoFromLevel(level+2)||this.canGoFromLevel(level+3);
			}
			if(flag==true) can[level] = 1;
			else can[level] = 0;
			return flag;
		//}
		 */
	}

	boolean isDirty(int index) {
		int flag = Arrays.binarySearch(this.dirtyIndex, index);
		if(flag<0) return false;
		else return true;
	}

	public static void main(String[] args) {
		/*
		CF_212_II_B test = new CF_212_II_B();
		int[] count = {5,2};
		int[] dirty = {4,5};
		test.setup(count, dirty);
		System.out.println(test.canGoFromLevel(1));
		System.out.println(Arrays.toString(test.stair));
		*/
		//int total = 1000000000;
		CF_212_II_B test = new CF_212_II_B();
		Scanner in = new Scanner(System.in);
		int totalNum = in.nextInt();
		int dirtyNum = in.nextInt();
		test.dirtyIndex = new int[dirtyNum];
		for(int i=0;i<test.dirtyIndex.length;i++) {
			test.dirtyIndex[i] = in.nextInt();
		}
		in.close();
		Arrays.sort(test.dirtyIndex);
		if(test.dirtyIndex.length==0) {
			System.out.println("YES");
			return;
		}
		if(test.dirtyIndex[0]==1 || test.dirtyIndex[dirtyNum-1]==totalNum) {
			System.out.println("NO");
			return;
		}
		if(test.dirtyIndex.length<3) {
			System.out.println("YES");
			return;
		} else {
			for(int i=0;i<test.dirtyIndex.length-3;i++) {
				if(test.dirtyIndex[i]-test.dirtyIndex[i+1]==-1 &&
						test.dirtyIndex[i+1]-test.dirtyIndex[i+2]==-1) {
					System.out.println("NO");
					return;
				}
			}
			//System.out.println(Arrays.toString(test.dirtyIndex));
			System.out.println("YES");
		}

		/*
		if(test.isDirty(1) || test.isDirty(totalNum)) {
			System.out.println("NO");
			in.close();
			return;
		} else {
			boolean flag1 = test.isDirty(2);
			boolean flag2 = test.isDirty(3);
			for(int i=4;i<totalNum-3;i++) {
				boolean flag3 = test.isDirty(i);
				if(flag1&&flag2&&flag3) {
					System.out.println("NO");
					in.close();
					return;
				} else {
					flag1 = flag2;
					flag2 = flag3;
				}
			}
		}
		System.out.println("YES");
		in.close();
		return;
		*/
	}

}


import java.util.*;

//Petya and Staircases

public class CF_212_II_B {

	boolean[] stair;
	//int[] can;
	int[] dirtyIndex;

	void setup(int[] count,int[] dirty) {
		this.stair = new boolean[count[0]+1];
		//this.can = new int[count[0]+1];
		for(int i=0;i<stair.length;i++) {
			stair[i] = true;
			//can[i] = -1;
		}
		for(int i=0;i<dirty.length;i++) this.stair[dirty[i]] = false;
	}

	boolean canGoFromLevel(int level) {

		if(this.stair[level]==false || this.stair[this.stair.length-1]==false) return false;
		else {
			for(int i=level+1;i<this.stair.length-3;i++) {
				if(stair[i]==false&&stair[i+1]==false&&stair[i+2]==false) return false;
			}
		}
		return true;
		/*
		//if(level>this.stair.length-1) return true;
		if(level<this.stair.length) {
			if(can[level]==0) return false;
			if(can[level]==1) return true;
			if(this.stair[level]==false) return false;
		}
		//else {
			boolean flag = false;
			if(this.stair.length-level==3) {
				flag = this.canGoFromLevel(level+1) || this.canGoFromLevel(level+2);
			} else if(this.stair.length-level==2) {
				flag = this.canGoFromLevel(level+1);
			} else if(this.stair.length-level==1) {
				flag = this.stair[level];
			} else {
				flag = this.canGoFromLevel(level+1)||
						this.canGoFromLevel(level+2)||this.canGoFromLevel(level+3);
			}
			if(flag==true) can[level] = 1;
			else can[level] = 0;
			return flag;
		//}
		 */
	}

	boolean isDirty(int index) {
		int flag = Arrays.binarySearch(this.dirtyIndex, index);
		if(flag<0) return false;
		else return true;
	}

	public static void main(String[] args) {
		/*
		CF_212_II_B test = new CF_212_II_B();
		int[] count = {5,2};
		int[] dirty = {4,5};
		test.setup(count, dirty);
		System.out.println(test.canGoFromLevel(1));
		System.out.println(Arrays.toString(test.stair));
		*/
		//int total = 1000000000;
		CF_212_II_B test = new CF_212_II_B();
		Scanner in = new Scanner(System.in);
		int totalNum = in.nextInt();
		int dirtyNum = in.nextInt();
		test.dirtyIndex = new int[dirtyNum];
		for(int i=0;i<test.dirtyIndex.length;i++) {
			test.dirtyIndex[i] = in.nextInt();
		}
		in.close();
		Arrays.sort(test.dirtyIndex);
		if(test.dirtyIndex[0]==1 || test.dirtyIndex[dirtyNum-1]==totalNum) {
			System.out.println("NO");
			return;
		}
		if(test.dirtyIndex.length<3) {
			System.out.println("YES");
			return;
		} else {
			for(int i=0;i<test.dirtyIndex.length-3;i++) {
				if(test.dirtyIndex[i]-test.dirtyIndex[i+1]==-1 &&
						test.dirtyIndex[i+1]-test.dirtyIndex[i+2]==-1) {
					System.out.println("NO");
					return;
				}
			}
			//System.out.println(Arrays.toString(test.dirtyIndex));
			System.out.println("YES");
		}

		/*
		if(test.isDirty(1) || test.isDirty(totalNum)) {
			System.out.println("NO");
			in.close();
			return;
		} else {
			boolean flag1 = test.isDirty(2);
			boolean flag2 = test.isDirty(3);
			for(int i=4;i<totalNum-3;i++) {
				boolean flag3 = test.isDirty(i);
				if(flag1&&flag2&&flag3) {
					System.out.println("NO");
					in.close();
					return;
				} else {
					flag1 = flag2;
					flag2 = flag3;
				}
			}
		}
		System.out.println("YES");
		in.close();
		return;
		*/
	}

}


import java.util.*;

//Petya and Staircases

public class CF_212_II_B {

	boolean[] stair;
	//int[] can;
	int[] dirtyIndex;

	void setup(int[] count,int[] dirty) {
		this.stair = new boolean[count[0]+1];
		//this.can = new int[count[0]+1];
		for(int i=0;i<stair.length;i++) {
			stair[i] = true;
			//can[i] = -1;
		}
		for(int i=0;i<dirty.length;i++) this.stair[dirty[i]] = false;
	}

	boolean canGoFromLevel(int level) {

		if(this.stair[level]==false || this.stair[this.stair.length-1]==false) return false;
		else {
			for(int i=level+1;i<this.stair.length-3;i++) {
				if(stair[i]==false&&stair[i+1]==false&&stair[i+2]==false) return false;
			}
		}
		return true;
		/*
		//if(level>this.stair.length-1) return true;
		if(level<this.stair.length) {
			if(can[level]==0) return false;
			if(can[level]==1) return true;
			if(this.stair[level]==false) return false;
		}
		//else {
			boolean flag = false;
			if(this.stair.length-level==3) {
				flag = this.canGoFromLevel(level+1) || this.canGoFromLevel(level+2);
			} else if(this.stair.length-level==2) {
				flag = this.canGoFromLevel(level+1);
			} else if(this.stair.length-level==1) {
				flag = this.stair[level];
			} else {
				flag = this.canGoFromLevel(level+1)||
						this.canGoFromLevel(level+2)||this.canGoFromLevel(level+3);
			}
			if(flag==true) can[level] = 1;
			else can[level] = 0;
			return flag;
		//}
		 */
	}

	boolean isDirty(int index) {
		int flag = Arrays.binarySearch(this.dirtyIndex, index);
		if(flag<0) return false;
		else return true;
	}

	public static void main(String[] args) {
		/*
		CF_212_II_B test = new CF_212_II_B();
		int[] count = {5,2};
		int[] dirty = {4,5};
		test.setup(count, dirty);
		System.out.println(test.canGoFromLevel(1));
		System.out.println(Arrays.toString(test.stair));
		*/
		//int total = 1000000000;
		CF_212_II_B test = new CF_212_II_B();
		Scanner in = new Scanner(System.in);
		int totalNum = in.nextInt();
		int dirtyNum = in.nextInt();
		test.dirtyIndex = new int[dirtyNum];
		for(int i=0;i<test.dirtyIndex.length;i++) {
			test.dirtyIndex[i] = in.nextInt();
		}
		in.close();
		Arrays.sort(test.dirtyIndex);
		if(test.dirtyIndex.length<3) {
			System.out.println("YES");
			return;
		}
		if(test.dirtyIndex[0]==1 || test.dirtyIndex[dirtyNum-1]==totalNum) {
			System.out.println("NO");
			return;
		} else {
			for(int i=0;i<test.dirtyIndex.length-3;i++) {
				if(test.dirtyIndex[i]-test.dirtyIndex[i+1]==-1 &&
						test.dirtyIndex[i+1]-test.dirtyIndex[i+2]==-1) {
					System.out.println("NO");
					return;
				}
			}
			//System.out.println(Arrays.toString(test.dirtyIndex));
			System.out.println("YES");
		}
		/*
		if(test.isDirty(1) || test.isDirty(totalNum)) {
			System.out.println("NO");
			in.close();
			return;
		} else {
			boolean flag1 = test.isDirty(2);
			boolean flag2 = test.isDirty(3);
			for(int i=4;i<totalNum-3;i++) {
				boolean flag3 = test.isDirty(i);
				if(flag1&&flag2&&flag3) {
					System.out.println("NO");
					in.close();
					return;
				} else {
					flag1 = flag2;
					flag2 = flag3;
				}
			}
		}
		System.out.println("YES");
		in.close();
		return;
		*/
	}

}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class B362 {
  static FastScanner in;
  static FastWriter out;

  public static void main(String[] args) throws IOException {
    in = new FastScanner(System.in);
    out = new FastWriter(System.out);

    int n = in.nextInt();
    int m = in.nextInt();
    int[] a = new int[m];
    for (int i = 0; i < m; i++)
      a[i] = in.nextInt();
    Arrays.sort(a);
    if (a[0] == 1 || a[m - 1] == n) {
      out.println("NO");
    } else {
      boolean bad = false;
      for (int i = 0; i < m - 2; i++)
        if (a[i] + 1 == a[i + 1] && a[i + 1] + 1 == a[i + 2]) bad = true;
      if (bad) out.println("NO");
      else out.println("YES");
    }

    out.close();
  }

  static class FastScanner {
    BufferedReader br;
    StringTokenizer st;

    public FastScanner(InputStream in) {
      br = new BufferedReader(new InputStreamReader(in));
      st = new StringTokenizer("");
    }

    public FastScanner(File f) throws IOException {
      br = new BufferedReader(new FileReader(f));
      st = new StringTokenizer("");
    }

    public int nextInt() throws IOException {
      return Integer.parseInt(next());
    }

    public long nextLong() throws IOException {
      return Long.parseLong(next());
    }

    public double nextDouble() throws IOException {
      return Double.parseDouble(next());
    }

    public String next() throws IOException {
      if (st.hasMoreTokens()) return st.nextToken();
      st = new StringTokenizer(br.readLine());
      return next();
    }
  }

  static class FastWriter extends PrintWriter {
    public FastWriter(OutputStream out) throws IOException {
      super(new BufferedWriter(new OutputStreamWriter(out)));
    }

    public FastWriter(File f) throws IOException {
      super(new BufferedWriter(new FileWriter(f)));
    }
  }
}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class B362 {
  static FastScanner in;
  static FastWriter out;

  public static void main(String[] args) throws IOException {
    in = new FastScanner(System.in);
    out = new FastWriter(System.out);

    int n = in.nextInt();
    int m = in.nextInt();
    int[] a = new int[m];
    for (int i = 0; i < m; i++)
      a[i] = in.nextInt();
    if (m == 0) {
      out.println("YES");
    } else {
      Arrays.sort(a);
      if (a[0] == 1 || a[m - 1] == n) {
        out.println("NO");
      } else {
        boolean bad = false;
        for (int i = 0; i < m - 2; i++)
          if (a[i] + 1 == a[i + 1] && a[i + 1] + 1 == a[i + 2]) bad = true;
        if (bad) out.println("NO");
        else out.println("YES");
      }
    }

    out.close();
  }

  static class FastScanner {
    BufferedReader br;
    StringTokenizer st;

    public FastScanner(InputStream in) {
      br = new BufferedReader(new InputStreamReader(in));
      st = new StringTokenizer("");
    }

    public FastScanner(File f) throws IOException {
      br = new BufferedReader(new FileReader(f));
      st = new StringTokenizer("");
    }

    public int nextInt() throws IOException {
      return Integer.parseInt(next());
    }

    public long nextLong() throws IOException {
      return Long.parseLong(next());
    }

    public double nextDouble() throws IOException {
      return Double.parseDouble(next());
    }

    public String next() throws IOException {
      if (st.hasMoreTokens()) return st.nextToken();
      st = new StringTokenizer(br.readLine());
      return next();
    }
  }

  static class FastWriter extends PrintWriter {
    public FastWriter(OutputStream out) throws IOException {
      super(new BufferedWriter(new OutputStreamWriter(out)));
    }

    public FastWriter(File f) throws IOException {
      super(new BufferedWriter(new FileWriter(f)));
    }
  }
}


import java.text.ParseException;
import java.util.*;
import java.io.*;

import static java.lang.Math.*;

    public class solver {

    final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE")!=null;

    BufferedReader in;
    static PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    void init() throws FileNotFoundException{
        if (ONLINE_JUDGE){
             in = new BufferedReader(new InputStreamReader(System.in));
             out = new PrintWriter(System.out);
        }else{
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        }
    }

    String readString() throws IOException{
        while(!tok.hasMoreTokens()){
            try{
                tok = new StringTokenizer(in.readLine());
            }catch (Exception e){
                return null;
            }
        }
        return tok.nextToken();
    }

    int readInt() throws IOException{
        return Integer.parseInt(readString());
    }

    long readLong() throws IOException{
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException{
        return Double.parseDouble(readString());
    }

    public static void main(String[] args) throws IOException, ParseException{
        new solver().run();
    }

    long timeBegin, timeEnd;

    void time(){
        timeEnd = System.currentTimeMillis();
        System.err.println("Time = " + (timeEnd - timeBegin));
    }
    int[] iMas(int n) throws IOException{
        int[] a=new int[n];
        for (int i=0;i<n;i++){
            a[i]=readInt();
        }
        return a;
    }
    void oMas(int[] a){
        for (int i=0;i<a.length;i++){
            out.println(a[i]);
        }
    }

    public void solve() throws IOException, ParseException{
        int n=readInt();
        int m=readInt();
        ArrayList<Integer> list=new ArrayList<Integer>();
        for (int i=0;i<m;i++){
            int x=readInt();
            if (x==n || x==1) {
                out.println("NO");
                return;
            }
            if (x>1){
                list.add(x);
            }
        }
        Collections.sort(list);
        for (int i=1;i<list.size()-1;i++){
            if (list.get(i)-list.get(i-1)==1 && list.get(i+1)-list.get(i)==1){
                out.println("NO");
                return;
            }
        }
        out.println("YES");
    }

    public void run() throws IOException, ParseException{
        init();
        solve();
        out.close();
    }

}


import java.text.ParseException;
import java.util.*;
import java.io.*;

import static java.lang.Math.*;

    public class solver {

    final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE")!=null;

    BufferedReader in;
    static PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    void init() throws FileNotFoundException{
        if (ONLINE_JUDGE){
             in = new BufferedReader(new InputStreamReader(System.in));
             out = new PrintWriter(System.out);
        }else{
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        }
    }

    String readString() throws IOException{
        while(!tok.hasMoreTokens()){
            try{
                tok = new StringTokenizer(in.readLine());
            }catch (Exception e){
                return null;
            }
        }
        return tok.nextToken();
    }

    int readInt() throws IOException{
        return Integer.parseInt(readString());
    }

    long readLong() throws IOException{
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException{
        return Double.parseDouble(readString());
    }

    public static void main(String[] args) throws IOException, ParseException{
        new solver().run();
    }

    long timeBegin, timeEnd;

    void time(){
        timeEnd = System.currentTimeMillis();
        System.err.println("Time = " + (timeEnd - timeBegin));
    }
    int[] iMas(int n) throws IOException{
        int[] a=new int[n];
        for (int i=0;i<n;i++){
            a[i]=readInt();
        }
        return a;
    }
    void oMas(int[] a){
        for (int i=0;i<a.length;i++){
            out.println(a[i]);
        }
    }

    public void solve() throws IOException, ParseException{
        int n=readInt();
        int[] dp=new int[n];
        int m=readInt();
        ArrayList<Integer> list=new ArrayList<Integer>();
        for (int i=0;i<m;i++){
            int x=readInt();
            if (x==n) {
                out.println("NO");
                return;
            }
            if (x>1){
                list.add(x);
            }
        }
        Collections.sort(list);
        for (int i=1;i<list.size()-1;i++){
            if (list.get(i)-list.get(i-1)==1 && list.get(i+1)-list.get(i)==1){
                out.println("NO");
                return;
            }
        }
        out.println("YES");
    }

    public void run() throws IOException, ParseException{
        init();
        solve();
        out.close();
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

		String line;

		outer: while ((line = in.readLine()) != null) {

			StringTokenizer st = new StringTokenizer(line);

			int n = Integer.parseInt(st.nextToken());

			int bad = Integer.parseInt(st.nextToken());

			String[] keep = new String[bad+1];

			st = new StringTokenizer(in.readLine());

			int i = 1;
			while (bad-- > 0) {

				String s = st.nextToken();

				if(s.equals("1")||s.equals("" + n)) {
					System.out.println("NO");
					continue outer;
				}

				keep[i++] = s;
			}

			int len = keep.length-1;
			Arrays.sort(keep, 1, len);

			int count = 1;

			for(int c = 2; c <= len;c++) {
				if(Integer.parseInt(keep[c])-Integer.parseInt(keep[c-1])==1) {
					count++;
					if(count==3) {
						System.out.println("NO");
						continue outer;
					}
				} else count = 1;
			}
			System.out.println("YES");
		}
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

		String line;

		outer: while ((line = in.readLine()) != null) {

			StringTokenizer st = new StringTokenizer(line);

			int n = Integer.parseInt(st.nextToken());

			int bad = Integer.parseInt(st.nextToken());

			String[] keep = new String[bad + 1];

			if(bad==0) continue;
			st = new StringTokenizer(in.readLine());

			int len = bad;
			int i = 1;
			while (bad-- > 0) {

				String s = st.nextToken();

				if (s.equals("1") || s.equals("" + n)) {
					System.out.println("NO");
					continue outer;
				}

				keep[i++] = s;
			}

			if (len != 0)
				Arrays.sort(keep, 1, len);

			int count = 1;

			for (int c = 2; c <= len; c++) {
				if (Integer.parseInt(keep[c]) - Integer.parseInt(keep[c - 1]) == 1) {
					count++;
					if (count == 3) {
						System.out.println("NO");
						continue outer;
					}
				} else
					count = 1;
			}
			System.out.println("YES");
		}
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

		String line;

		outer: while ((line = in.readLine()) != null) {

			StringTokenizer st = new StringTokenizer(line);

			int n = Integer.parseInt(st.nextToken());

			int bad = Integer.parseInt(st.nextToken());

			String[] keep = new String[bad + 1];

			if(bad!=0)
			st = new StringTokenizer(in.readLine());

			int len = bad;
			int i = 1;
			while (bad-- > 0) {

				String s = st.nextToken();

				if (s.equals("1") || s.equals("" + n)) {
					System.out.println("NO");
					continue outer;
				}

				keep[i++] = s;
			}

			if (len != 0)
				Arrays.sort(keep, 1, len);

			int count = 1;

			for (int c = 2; c <= len; c++) {
				if (Integer.parseInt(keep[c]) - Integer.parseInt(keep[c - 1]) == 1) {
					count++;
					if (count == 3) {
						System.out.println("NO");
						continue outer;
					}
				} else
					count = 1;
			}
			System.out.println("YES");
		}
	}
}


import java.io.InputStreamReader;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Samin Arefin
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		OutputWriter out = new OutputWriter(outputStream);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskB {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
        int n = in.nextInt(); // total stairs
        int b = in.nextInt();

        int[] bad = new int[b];

        for (int i = 0; i < b; i++) {
            bad[i] = in.nextInt();
            if (bad[i] == 1 || bad[i] == n) {
                out.printLine("NO");
                return;
            }
        }
        Arrays.sort(bad);

        int count = 1;
        for (int i = 1; i < b; i++) {
            if (bad[i] - bad[i - 1] == 1) {
                count++;
                if (count == 3) {
                    out.printLine("NO");
                    return;
                }
            } else
                count = 1;
        }

        out.printLine("YES");
    }
}

class InputReader {

    private BufferedReader reader;
    private StringTokenizer token;
    private InputStream stream;

    public InputReader(InputStream stream) {
        this.stream = stream;
        reader = new BufferedReader(new InputStreamReader(stream));
    }

    public String next() {
        while (token == null || !token.hasMoreElements()) {
            try {
                token = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        return token.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void close() {
        writer.close();
    }

    public void printLine(Object o){
        writer.println(o);
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

		String line;

		outer: while ((line = in.readLine()) != null) {

			StringTokenizer st = new StringTokenizer(line);

			int n = Integer.parseInt(st.nextToken());

			int bad = Integer.parseInt(st.nextToken());

			String[] keep = new String[bad + 1];

			st = new StringTokenizer(in.readLine());

			int len = bad;
			int i = 1;
			while (bad-- > 0) {

				String s = st.nextToken();

				if (s.equals("1") || s.equals("" + n)) {
					System.out.println("NO");
					continue outer;
				}

				keep[i++] = s;
			}

			if (len != 0)
				Arrays.sort(keep, 1, len);

			int count = 1;

			for (int c = 2; c <= len; c++) {
				if (Integer.parseInt(keep[c]) - Integer.parseInt(keep[c - 1]) == 1) {
					count++;
					if (count == 3) {
						System.out.println("NO");
						continue outer;
					}
				} else
					count = 1;
			}
			System.out.println("YES");
		}
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

		String line;

		outer: while ((line = in.readLine()) != null) {

			StringTokenizer st = new StringTokenizer(line);

			int n = Integer.parseInt(st.nextToken());

			int bad = Integer.parseInt(st.nextToken());

			int[] keep = new int[bad];

			if (bad != 0)
				st = new StringTokenizer(in.readLine());

			int len = bad;
			int i = 0;
			while (bad-- > 0) {

				String s = st.nextToken();

				if (s.equals("1") || s.equals(""+n)) {
					System.out.println("NO");
					continue outer;
				}

				keep[i++] = Integer.parseInt(s);
			}

			Arrays.sort(keep);

			int count = 1;

			for (int c = 1; c < len; c++) {
				if (keep[c] - keep[c - 1] == 1) {
					count++;
					if (count == 3) {
						System.out.println("NO");
						continue outer;
					}
				} else
					count = 1;
			}
			System.out.println("YES");
		}
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

		String line;

		outer: while ((line = in.readLine()) != null) {

			StringTokenizer st = new StringTokenizer(line);

			int n = Integer.parseInt(st.nextToken());

			int[] stair = new int[n + 3];

			int bad = Integer.parseInt(st.nextToken());

			st = new StringTokenizer(in.readLine());

			while (bad-- > 0) {

				int b = Integer.parseInt(st.nextToken());
				if (b == 1 || b == n) {
					System.out.println("NO");
					continue outer;
				}
				stair[b] = 1;
			}

			;
			for (int i = 1; i <= n; i++) {
				if (stair[i] == 1 && stair[i + 1] == 1 && stair[i + 2] == 1) {
					System.out.println("NO");
					continue outer;
				}
			}

			System.out.println("YES");
		}
	}
}


import java.util.*;
import java.io.*;

public class B {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int m = input.nextInt();

        PriorityQueue<Integer> bad = new PriorityQueue<Integer>();

        for(int i = 0; i < m; i++) {
            bad.add(input.nextInt());
        }

        Integer[] a = new Integer[m];

        a = bad.toArray(a);

        Arrays.sort(a);

        if(m == 0) { System.out.println("NO"); System.exit(0); }

        if((int) a[0] == 1 || (int) a[a.length - 1] == n) {
            System.out.println("NO");
            System.exit(0);
        }

        boolean bool = true;
        for(int i = 0; i < a.length - 2; i++) {
            if(a[i] == a[i + 1] - 1) {
                if(a[i + 1] == a[i + 2] - 1) {
                    bool = false;
                }
            }
        }

        if(!bool)
            System.out.println("NO");
        else
            System.out.println("YES");
    }
}


import java.util.*;
import java.io.*;

public class B {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int m = input.nextInt();

        PriorityQueue<Integer> bad = new PriorityQueue<Integer>();

        for(int i = 0; i < m; i++) {
            bad.add(input.nextInt());
        }

        Integer[] a = new Integer[m];

        a = bad.toArray(a);

        Arrays.sort(a);

        if(m == 0) { System.out.println("NO"); System.exit(0); }

        boolean bool = true;
        for(int i = 0; i < a.length - 2; i++) {
            if(a[i] == a[i + 1] - 1) {
                if(a[i + 1] == a[i + 2] - 1) {
                    bool = false;
                }
            }
        }

        if(!bool)
            System.out.println("NO");
        else
            System.out.println("YES");
    }
}


import java.util.*;
import java.io.*;

public class B {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int m = input.nextInt();

        PriorityQueue<Integer> bad = new PriorityQueue<Integer>();

        for(int i = 0; i < m; i++) {
            bad.add(input.nextInt());
        }

        Integer[] a = new Integer[m];

        a = bad.toArray(a);

        Arrays.sort(a);

        if(m >= n) { System.out.println("NO"); System.exit(0); }

        if(m == 0) {
            System.out.println("YES");
            System.exit(0);
        }

        if((int) a[0] == 1 || (int) a[a.length - 1] == n) {
            System.out.println("NO");
            System.exit(0);
        }

        boolean bool = true;
        for(int i = 0; i < a.length - 2; i++) {
            if(a[i] == a[i + 1] - 1) {
                if(a[i + 1] == a[i + 2] - 1) {
                    bool = false;
                }
            }
        }

        if(!bool)
            System.out.println("NO");
        else
            System.out.println("YES");
    }
}


import java.util.*;
import java.io.*;

public class B {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int m = input.nextInt();

        PriorityQueue<Integer> bad = new PriorityQueue<Integer>();

        for(int i = 0; i < m; i++) {
            bad.add(input.nextInt());
        }

        Integer[] a = new Integer[m];

        a = bad.toArray(a);

        Arrays.sort(a);

        if(m == 0 || m >= n) { System.out.println("NO"); System.exit(0); }

        if((int) a[0] == 1 || (int) a[a.length - 1] == n) {
            System.out.println("NO");
            System.exit(0);
        }

        boolean bool = true;
        for(int i = 0; i < a.length - 2; i++) {
            if(a[i] == a[i + 1] - 1) {
                if(a[i + 1] == a[i + 2] - 1) {
                    bool = false;
                }
            }
        }

        if(!bool)
            System.out.println("NO");
        else
            System.out.println("YES");
    }
}


import java.util.*;
import java.io.*;

public class B {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int m = input.nextInt();

        PriorityQueue<Integer> bad = new PriorityQueue<Integer>();

        for(int i = 0; i < m; i++) {
            bad.add(input.nextInt());
        }

        Integer[] a = new Integer[m];

        a = bad.toArray(a);

        Arrays.sort(a);

        if(m == 0 || m == n || m > n) { System.out.println("NO"); System.exit(0); }

        boolean bool = true;
        for(int i = 0; i < a.length - 2; i++) {
            if(a[i] == a[i + 1] - 1) {
                if(a[i + 1] == a[i + 2] - 1) {
                    bool = false;
                }
            }
        }

        if(!bool)
            System.out.println("NO");
        else
            System.out.println("YES");
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class B362 {
	public static void main (String args[]){
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int m = in.nextInt();
		int a[] = new int[m];
		for(int i = 0 ; i < m ; i++){
			a[i] = in.nextInt();
		}
		Arrays.sort(a);
		if(a[0]==1 || a[m-1]==n){
			System.out.println("NO");
			return;
		}else {
			for(int i = 1 ; i < m-1 ; i++){
				if(((a[i+1]-a[i])+(a[i]-a[i-1]) == 2 && a[i+1]-a[i]!=2 && a[i]-a[i-1]!=2)){
					System.out.println("NO");
					return;
				}
			}
			System.out.println("YES");
		}
	}

}


import java.util.Arrays;
import java.util.Scanner;

public class B349 {
	public static void main (String args[]){
		Scanner in = new Scanner(System.in);
		int r = in.nextInt();
		Pair2 p []= new Pair2[9];
		for(int i = 0 ; i < 9 ; i++){
			p[i] = new Pair2(i+1, in.nextInt());
		}
		Arrays.sort(p);
		int c = r/p[0].val;
		r = r - c * p[0].val;
		if(r==0){
			StringBuffer sb = new StringBuffer();
			for(int i = 0 ; i < c; i++){
				sb.append(p[0].num);
			}
			if(sb.length()<1){
				System.out.println(-1);
				return;
			}
			System.out.println(sb.toString());
			return;
		}
		else if(c!=0) {
			r = r + p[0].val;
			int n2 = -1;
			for(int i = 0 ; i < 9 ; i++){
				if(r >= p[i].val){
					n2 = Math.max(n2, p[i].num);
				}
			}
			StringBuffer sb = new StringBuffer();
			if(n2!=-1){
				sb.append(n2);
				for(int i = 1 ; i < c ; i++){
					sb.append(p[0].num);
				}
				if(sb.length()<1){
					System.out.println(-1);
					return;
				}
				System.out.println(sb.toString());
				return;
			}
			else {
				for(int i = 0 ; i < c; i++){
					sb.append(p[0].num);
				}
				if(sb.length()<1){
					System.out.println(-1);
					return;
				}
				System.out.println(sb.toString());
				return;
			}
		}
		else {
			System.out.println(-1);
		}
	}

}
class Pair2 implements Comparable<Pair2>{
	int num ;
	int val ;
	public Pair2(int num , int val){
		this.num = num;
		this.val = val;
	}
	@Override
	public int compareTo(Pair2 arg0) {
		if(val==arg0.val){
			return arg0.num-num;
		}
		return val-arg0.val;
	}

}


import java.util.Arrays;
import java.util.Scanner;

public class B362 {
	public static void main (String args[]){
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int m = in.nextInt();
		int a[] = new int[m];
		for(int i = 0 ; i < m ; i++){
			a[i] = in.nextInt();
		}
		Arrays.sort(a);
		if(m!=0){
			if(a[0]==1 || a[m-1]==n){
				System.out.println("NO");
				return;
			}else {
				if(m<3){
					System.out.println("YES");
					return;
				}
				for(int i = 1 ; i < m-1 ; i++){
					if(((a[i+1]-a[i])+(a[i]-a[i-1]) == 2 && a[i+1]-a[i]!=2 && a[i]-a[i-1]!=2)){
						System.out.println("NO");
						return;
					}
				}
				System.out.println("YES");
			}
		}
		else {
			System.out.println("YES");
		}
	}

}


import java.util.Arrays;
import java.util.Scanner;

public class cola {

    public static void main(String ar[])
    {
    Scanner obj=new Scanner(System.in);
    int n=obj.nextInt();
    int m=obj.nextInt();

    int num[]=new int[m];
    for(int i=0;i<m;i++){

    num[i]=obj.nextInt();
    if((num[i]==1||num[i]==n))
    {
        System.out.print("NO");
        return;
    }
    }
    Arrays.sort(num);
    for(int j=0;j<m-2;j++)
    {
        if(num[j]+1==num[j+1]&&num[j+1]==num[j+2]+1)
        {
        System.out.print("NO");
        return;}

    }

    System.out.print("YES");
    }
    }


import java.util.Arrays;
import java.util.Scanner;

public class cola {

    public static void main(String ar[])
    {
    Scanner obj=new Scanner(System.in);
    int n=obj.nextInt();
    int m=obj.nextInt();

    int num[]=new int[m];
    for(int i=0;i<m;i++){

    num[i]=obj.nextInt();
    if((num[i]==1||num[i]==n))
    {
        System.out.print("NO");
        return;
    }
    }
    Arrays.sort(num);
    for(int j=0;j<m-2;j++)
    {
        if(num[j]+1==num[j+1]&&num[j]+2==num[j+2])
        {
        System.out.print("NO");
        return;}

    }

    System.out.print("YES");
    }
    }


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class petyaStairs {

    public static void main(String[] args) throws IOException {

        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        String[] s=br.readLine().split(" ");

        int n=Integer.parseInt(s[0]);
        int m=Integer.parseInt(s[1]);

        int[] arr=new int[m];
        s=br.readLine().split(" ");
        for(int i=0;i<m;i++){
            arr[i]=Integer.parseInt(s[i]);
        }

        Arrays.sort(arr);
        int c=0;
        boolean z=false;

        if(arr[0]==1 || arr[m-1]==n)
            z=true;

        for(int i=0;i<m-1&&!z;i++){

            if(arr[i]+1==arr[i+1]){
                c++;
            }else
                c=0;
            if(c==2){
                z=true;
                break;
            }
        }
        if(z)
            System.out.println("NO");
        else
            System.out.println("YES");
    }

}