#include <iostream>
using namespace std;
int main()
{
int a =0;
string c;
cin >> c;
int cnt = 0;
int leng = c.length();
//cout << leng<< endl;
for (int i =0; i <c.length(); i++)
{
switch(c[i]){
case '!' ... '~':
a++;
break;
default:
cout << "NO"<< endl;
return 0;
}
}
switch(c.length()){
case 8 ... 14:
a++;
break;
default:
cout << "NO"<< endl;
return 0;
}
for (int i =0; i <c.length(); i++)
{
switch(c[i]){
case 'A' ... 'Z':
i = leng;
cnt+=1;
break;
default:
break;
}
if (leng== i+1)
{
break;
//cout <<"BAD VALUE3" << endl;
//return 0;
}
}
for (int i =0; i <c.length(); i++)
{
switch(c[i]){
case 'a' ... 'z':
i = leng;
cnt+=1;
break;
default:
break;
}
if (leng== i+1)
{
break;
//cout <<"BAD VALUE4" << endl;
//return 0;
}
}
for (int i =0; i <c.length(); i++)
{
switch(c[i]){
case '0' ... '9':
i = leng;
cnt+=1;
break;
default:
break;
}
if (leng== i+1)
{
break;
//cout <<"BAD VALUE5" << endl;
//return 0;
}
}
for (int i =0; i <c.length(); i++)
{
switch(c[i]){
case '{' ... '~':
i = leng;
cnt+=1;
break;
case '[' ... '_': // ' - вопрос
i = leng;
cnt+=1;
break;
case ':' ... '@':
i = leng;
cnt+=1;
break;
case '!' ... '/':
i = leng;
cnt+=1;
break;
default:
break;
}
if (cnt >=3)
{
cout <<"YES" << endl;
return 0;
}
if (leng== i+1)
{
break;
//cout <<"BAD VALUE6" << endl;
//return 0;
}
}
if (cnt >=3)
{
cout <<"YES" << endl;
return 0;
}
else
cout <<"NO" << endl;
}