This page is still under construction.

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

Ah!

Interview

Time limit1sMemory limit128 MB

Summary
Compare two strings of the form a...ah and print go if the first has at least as many a characters as the second.
Level

Easy2 of 10

Topics
String, Implementation
Solved
No attempts yet

Problem

Jaehwan shouted so much at a concert that he got a sore throat.

The doctor asks Jaehwan to say "ah". This sound is written as some number of a characters followed by a single h (for example, aaah). Unfortunately, Jaehwan sometimes cannot hold the sound for as long as the doctor wants.

Each doctor asks for a sound of a specific length. Some ask for something long like aaaaaah, while others ask only for h.

A doctor can make a diagnosis only after hearing a sound of the length they requested.

Jaehwan knows the longest sound he can make, and he wants to visit only a doctor whose request he can meet.

Given the sound Jaehwan can make and the sound the doctor requests, write a program that decides whether Jaehwan should go to that clinic.

Input

The input consists of two lines.

  • Line 1: the longest sound Jaehwan can make.
  • Line 2: the sound the doctor wants to hear.

Both strings consist only of the lowercase letters a and h. In each string the number of a characters is between 0 and 999 inclusive, and there is always exactly one h at the very end.

Output

Print go if Jaehwan should go to the clinic, otherwise print no.

Jaehwan can go to the clinic only if the number of a characters in the sound he can make is greater than or equal to the number of a characters the doctor requests.

Examples4

  1. Example 1

    Input
    aaah
    aaaaah
    
    Expected output
    no
    
  2. Example 2

    Input
    aaah
    ah
    
    Expected output
    go
    
  3. Example 3

    Input
    aaah
    aaah
    
    Expected output
    go
    
  4. Example 4

    Input
    aaah
    h
    
    Expected output
    go