This page is still under construction.

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

Dickensian Dictionary

Interview

Time limit1sMemory limit1024 MB

Summary
Given a lowercase word, decide whether the hands typing its letters alternate between left and right on every step.
Level

Easy2 of 10

Topics
String, Implementation
Solved
No attempts yet

Problem

You are stuck in your job at the Boring Accountancy Platform Company; the entire day you have to code all kinds of programs that you do not care about. This involves a lot of tedious typing, which you do not want to do. To pass the time, you decide to interact with the words you type more playfully. In particular, you really enjoy it when you type a word with your left and right hand alternating. You dub these words Dickensian.

Your mind is quickly overwhelmed with Dickensian words, and even at home they still dictate your thoughts. You want to gather as many Dickensian words as possible and start coding. Given a word, you will need to decide if it is Dickensian or not.

The letters you can type with your left hand are "qwertasdfgzxcvb", and the letters you can type with your right hand are "yuiophjklnm".

Input

The input consists of:

  • One line containing a string of length at least 22 and at most 2020, consisting of lowercase characters a-z.

Output

Output "yes" if the input string is Dickensian, and "no" otherwise.

Examples4

  1. Example 1

    Input
    dickensian
    
    Expected output
    yes
    
  2. Example 2

    Input
    dictionary
    
    Expected output
    no
    
  3. Example 3

    Input
    usual
    
    Expected output
    yes
    
  4. Example 4

    Input
    suspects
    
    Expected output
    no