Tautogram

No attempts yetTime limit1sMemory limit128 MB

Problem

Seonyeong loves poetry. While reading a poetry collection recently, she came across a very charming poetic form. A tautogram is a special kind of alliteration in which every word of a sentence begins with the same letter.

In other words, a sentence is a tautogram if and only if all of its words start with the same letter. The comparison is case-insensitive.

For example, the following sentences are all tautograms:

  • Flowers Flourish from France
  • Sam Simmonds speaks softly
  • Peter pIckEd pePPers
  • truly tautograms triumph

Seonyeong wants to use tautograms to write a love letter. Given one sentence from her letter, write a program that determines whether it is a tautogram.

Input

The input consists of several test cases. Each test case is a single line corresponding to one sentence of the letter.

Each sentence contains at most 50 words separated by single spaces. Each word consists only of uppercase and lowercase letters and has length at most 20.

Every word contains at least one letter, and every sentence contains at least one word.

The line following the last test case contains a single character *, marking the end of the input.

Output

For each test case, print Y on its own line if the given sentence is a tautogram, or N otherwise.