This page is still under construction.

Parts of this page are still being built. What you see may change.

Rotating Letters

Interview

Time limit1sMemory limit128 MB

Summary
Given a single uppercase word, decide whether every letter belongs to the set of seven letters that look the same after a 180-degree rotation.
Level

Easy2 of 10

Topics
String, Implementation, Hash map, Brute force
Solved
No attempts yet

Problem

An artist wants to build a sign whose letters rotate freely in the breeze. To do this, she may only use letters that look unchanged after a 180-degree rotation: I, O, S, H, Z, X, and N.

Given a single word, write a program that determines whether it can be used on the sign.

Input

The input consists of a single word made up only of uppercase letters, with no spaces. The word is at most 30 letters long and contains at least one letter.

Output

Output YES if the word can be used on the sign; otherwise, output NO.

Examples1

  1. Example 1

    Input
    SHINS
    
    Expected output
    YES