Problem: 

Input

The input consists of a single string of uppercase letters A-Z. The length of the string is between 1 and 10 characters, inclusive.

Output

Output "YES" or "NO".

Examples

Input


GENIUS


Output


YES


Input


DOCTOR


Output


NO


Input


IRENE


Output


YES


Input


MARY


Output


NO


Input


SMARTPHONE


Output


NO


Input


REVOLVER


Output


YES


Input


HOLMES


Output


NO


Input


WATSON


Output


YES

Solution (in JAVA):

Solution:
import java.util.*;
public class Main{
    static boolean solve(Set<String> set , String str){
        if(str.length()==0){
            return true;
        }
        boolean single = false;
        boolean doubl = false;
        // System.out.println(str);
        for(int i=0;i<str.length();i++){
            String singleChar = str.substring(i,i+1);
            String doubleChar="";
            if(i+1<str.length()) doubleChar += str.substring(i,i+2);
            if(set.contains(singleChar) || (i+1<str.length() && set.contains(doubleChar))){
                if(set.contains(singleChar)){
                    single = solve(set,str.substring(i+1));
                    if(single) return single;
                }
                if(i+1<str.length() && set.contains(doubleChar)){
                    doubl = solve(set , str.substring(i+2));
                    if(doubl) return doubl;
                }
            }else return false;
        }
        return true;
    }
    public static void main(String args[]){
        ArrayList<String> al = new ArrayList<>(Arrays.asList(
                                        "H" ,
                                        "He" ,
                                        "Li" ,
                                        "Be" ,
                                        "B" ,
                                        "C" ,
                                        "N" ,
                                        "O" ,
                                        "F" ,
                                        "Ne" ,
                                        "Na" ,
                                        "Mg" ,
                                        "Al" ,
                                        "Si" ,
                                        "P" ,
                                        "S" ,
                                        "Cl" ,
                                        "Ar" ,
                                        "K" ,
                                        "Ca" ,
                                        "Sc" ,
                                        "Ti" ,
                                        "V" ,
                                        "Cr" ,
                                        "Mn" ,
                                        "Fe" ,
                                        "Co" ,
                                        "Ni" ,
                                        "Cu" ,
                                        "Zn" ,
                                        "Ga" ,
                                        "Ge" ,
                                        "As" ,
                                        "Se" ,
                                        "Br" ,
                                        "Kr" ,
                                        "Rb" ,
                                        "Sr" ,
                                        "Y" ,
                                        "Zr" ,
                                        "Nb" ,
                                        "Mo" ,
                                        "Tc" ,
                                        "Ru" ,
                                        "Rh" ,
                                        "Pd" ,
                                        "Ag" ,
                                        "Cd" ,
                                        "In" ,
                                        "Sn" ,
                                        "Sb" ,
                                        "Te" ,
                                        "I" ,
                                        "Xe" ,
                                        "Cs" ,
                                        "Ba" ,
                                        "La" ,
                                        "Ce" ,
                                        "Pr" ,
                                        "Nd" ,
                                        "Pm" ,
                                        "Sm" ,
                                        "Eu" ,
                                        "Gd" ,
                                        "Tb" ,
                                        "Dy" ,
                                        "Ho" ,
                                        "Er" ,
                                        "Tm" ,
                                        "Yb" ,
                                        "Lu" ,
                                        "Hf" ,
                                        "Ta" ,
                                        "W" ,
                                        "Re" ,
                                        "Os" ,
                                        "Ir" ,
                                        "Pt" ,
                                        "Au" ,
                                        "Hg" ,
                                        "Tl" ,
                                        "Pb" ,
                                        "Bi" ,
                                        "Po" ,
                                        "At" ,
                                        "Rn" ,
                                        "Fr" ,
                                        "Ra" ,
                                        "Ac" ,
                                        "Th" ,
                                        "Pa" ,
                                        "U" ,
                                        "Np" ,
                                        "Pu" ,
                                        "Am" ,
                                        "Cm" ,
                                        "Bk" ,
                                        "Cf" ,
                                        "Es" ,
                                        "Fm" ,
                                        "Md" ,
                                        "No" ,
                                        "Lr" ,
                                        "Rf" ,
                                        "Db" ,
                                        "Sg" ,
                                        "Bh" ,
                                        "Hs" ,
                                        "Mt" ,
                                        "Ds" ,
                                        "Rg" ,
                                        "Cn" ,
                                        "Nh" ,
                                        "Fl" ,
                                        "Mc" ,
                                        "Lv" ,
                                        "Ts" ,
                                        "Og" 
        ));
        Set<String> set = new HashSet<>();
        Scanner scn = new Scanner(System.in);
        for(String str : al){
            set.add(str.toUpperCase());
        }
        String s = scn.next();
        
        System.out.println(solve(set , s) ? "YES":"NO");
        
    }
}