Problem:


Score : 100 points

Problem Statement

A Hitachi string is a concatenation of one or more copies of the string hi.

For example, hi and hihi are Hitachi strings, while ha and hii are not.

Given a string S, determine whether S is a Hitachi string.

Constraints

The length of S is between 1 and 10 (inclusive).

S is a string consisting of lowercase English letters.

Input

Input is given from Standard Input in the following format:

S

Output

If S is a Hitachi string, print Yes; otherwise, print No.

Sample Input 1

hihi

Sample Output 1

Yes

hihi is the concatenation of two copies of hi, so it is a Hitachi string.

Sample Input 2

hi

Sample Output 2

Yes

Sample Input 3

ha

Sample Output 3

No



Sample input:
hihi


Sample output:
Yes

Submission status: Accepted

Solution code:
s = input()
cnt = 0

if len(s)%2 == 1:
    print('No')
    exit()

for i in range(len(s)//2):
    if i == (len(s)/2):
        break
    if s[(i*2):(i+1)*2] != 'hi':
        cnt += 1

print('Yes' if cnt == 0 else 'No')

Submission status: Accepted

Solution code:
def main():
	s = input()
	for _ in range(15):
		s=s.replace("hi", " ")
	for _ in range(15):
		s=s.replace(" ", "")
	if s=="":
		print("Yes")
	else:
		print("No")

main()

Submission status: Accepted

Solution code:
n = input()
l = n.replace("hi","")

print("No" if len(set(l)) != 0 else "Yes")

Submission status: Accepted

Solution code:
S = input()
ans = []
for i in range(5):
    ans.append(S == "hi" * (i + 1))
if any(ans):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
if len(s)%2 == 0 and len(s)//2 == s.count('hi'):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
a = input()
ok = True
if len(a) % 2 == 0:
    for i in range(0, len(a)//2 + 1, 2):
        if a[i:i + 2] != "hi":
            ok = False
            break
else:
    ok = False


if ok:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input().strip()

if S.replace('hi', '') == '':
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()


if len(s) % 2 == 1:
    print('No')
    exit()

for i in range(len(s)//2):
    hi = s[i*2: i*2+2]
    if hi != 'hi':
        print('No')
        exit()

print('Yes')

Submission status: Accepted

Solution code:
import sys

q="hi"

S=input()

def check_hitachi(query):
    n=len(query)
    if n % 2 == 1:
        return False
    if query.find(q)==0:
        if n==2:
            return True;
        else:
            return check_hitachi(query[2:])
    else:
        return False

result=check_hitachi(S)
if result:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = list(input())
n = len(s)
if n % 2 == 0:
    for i in range(n//2):
        if s[2*i] != 'h' or s[2*i+1] != 'i':
            break
    else:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

Solution code:
s=list(input())
flag = "i"
count = 0
for i in range(len(s)):
  if flag =="h":
    if s[i] != "i":
      print("No")
      break
    else:
      flag = "i"
  elif flag =="i":
    if s[i] != "h":
      print("No")
      break
    else:
      flag = "h"
  if i == len(s)-1:
    if s[i]=="i":
      print("Yes")
    else:
      print("No")

Submission status: Accepted

Solution code:
S = input()

Sa = S.split('hi')
Sa = ''.join(Sa)
if len(S) != len(Sa) and len(Sa) == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
a='hi'
b=0
for n in range(5):
	if s==a*(n+1):
		print("Yes")
		b=1
if b!=1:
	print("No")

Submission status: Accepted

Solution code:
s = input()

flag = 0
if len(s)%2 != 0:
	print("No")
	exit()
else:
	for i in range(len(s)):
		if i%2 == 0:
			if s[i] != "h" or s[i+1] != "i":
				flag = 1
if flag == 1:
	print("No")
else:
	print("Yes")

Submission status: Accepted

Solution code:
S = input()

S = S.replace("hi", "")

if len(S) == 0:
    print("Yes")
else:
    print("No")

# if len(S) == 1:
#     print("No")
#     exit()
    
# for i in range(len(S)):
#     if i % 2 == 0:
#         if S[i] != "h":
#             print("No")
#             exit()
#     else:
#         if S[i] != "i":
#             print("No")
#             exit()

# print("Yes")

Submission status: Accepted

Solution code:
S = input()
print("Yes" if all(map(lambda x: x=="", S.split("hi"))) else "No")

Submission status: Accepted

Solution code:
S = input()
for i in range(0,len(S),2):
  if S[i:i+2] != 'hi':
    print('No')
    break
else:
  print('Yes')

Submission status: Accepted

Solution code:
s = input()
a = s.split("hi")
for i in a:
    if(i!=""):print("No");exit()
else:print("Yes")

Submission status: Accepted

Solution code:
S = str(input())
count = 0
if S == "hi":
    count = 1
if S == "hihi":
    count = 1
if S == "hihihi":
    count = 1
if S == "hihihihi":
    count = 1
if S == "hihihihihi":
    count = 1
if count ==1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S=input().replace("hi","")
print("Yes" if len(S)==0 else "No")

Submission status: Accepted

Solution code:
s = input()
if s == 'hi' or s == 'hihi' or s == 'hihihi' or s == 'hihihihi' or s =='hihihihihi':
    print('Yes')
else: print('No')

Submission status: Accepted

Solution code:
S = input()

flag = True
for i,s in enumerate(S):
    if len(S)%2==1:
        print('No')
        flag = False
        break
    elif i%2==1:
        if s != 'i':
            print('No')
            flag = False
            break
    elif i%2==0:
        if s != 'h':
            print('No')
            flag = False
            break
if flag == True:
    print('Yes')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
from collections import deque as deq
import re

S = input()

print('Yes' if re.match(r'^(hi)+$', S) else 'No')

Submission status: Accepted

Solution code:
s=input()
answer='Yes'
for i in range(len(s)):
    if len(s)%2==1:
        answer='No'
        break
    elif i%2==0:
        if s[i]!='h' or s[i+1]!='i':
            answer='No'
print(answer)

Submission status: Accepted

Solution code:
S = input()
if S.count("hi") == len(S)/2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()

if (S == 'hi')or(S == 'hihi')or(S == 'hihihi')or(S =='hihihihi')or(S == 'hihihihihi'):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()

if S=='hi':
    print("Yes")
elif S=='hihi':
    print("Yes")
elif S=='hihihi':
    print("Yes")
elif S=='hihihihi':
    print("Yes")
elif S=='hihihihihi':
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
ans = True
if len(s) % 2 != 0:
    print('No')
    exit()

for i in range(0, len(s)-1, 2):
    ans = ans and s[i:i+2] == 'hi'

if ans:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = str(input())

Sample = ["hi","hihi","hihihi","hihihihi","hihihihihi"]

if s in Sample:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys

S = sys.stdin.readline().strip()
if len(S) % 2:
    print("No")
    sys.exit()

for i, s in enumerate(S):
   if i % 2 == 0 and s == "h":
       continue
   elif i % 2 == 1 and s == "i":
       continue
   else:
       print("No")
       sys.exit()

print("Yes")

Submission status: Accepted

Solution code:
S = input()

if len(S) % 2 != 0:
    print("No")
    exit()

for i in range(0, len(S)):
    if i % 2 == 0:
        if S[i] != 'h':
            print("No")
            exit()
    else:
        if S[i] != 'i':
            print("No")
            exit()
print("Yes")

Submission status: Accepted

Solution code:
s = input()
n = len(s)
if n % 2 == 1:
  print('No')
elif n % 2 == 0 :
  n = n // 2
  moji =''
  for i in range(n):
    moji += 'hi'
  if s == moji:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
print("Yes" if s.count("hi") == len(s)/2  else "No")

Submission status: Accepted

Solution code:
s=input()

for i in range(len(s)):
    if i%2==0:
        if s[i]!='h':
            print('No')
            exit()
    if i%2==1:
        if s[i]!='i':
            print('No')
            exit()

if len(s)%2==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()

if len(S)%2==1:
    print('No')
    exit()

for (i,j) in zip(S[::2],S[1::2]):

    if not (i == 'h' and j == 'i'):
        print('No')
        exit()
print("Yes")

Submission status: Accepted

Solution code:
s = input()

count = 0
for index in range(len(s)):
    if index % 2 == 0 and index - 2 <= len(s):
        if s[index:index + 2] == "hi":
            pass
        else:
            count += 1

if count == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
list = S.split('hi')
while '' in list:
  list.remove('')
if len(list) == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import sys
text = input()
flag = 0
for s in text:
    if flag == 0 and s == "h":
        flag = 1
    elif flag ==1 and s == "i":
        flag = 0
    else:
        print("No")
        sys.exit()
if flag == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=list(input())
a=0
if len(s)%2==1:
    print("No")
    #print("a")
else:
    b=0
    for i in range(len(s)//2):
        if s[b]+s[b+1]!="hi":
            a=1
            break
        b+=2
    print("Yes" if a==0 else "No")

Submission status: Accepted

Solution code:
s=input()
if s=='hi' or s=='hihi' or s=='hihihi' or s=='hihihihi' or s=='hihihihihi':
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()

ans = s.split('hi')
for p in s.split('hi'):
	if p != '':
		ans = False
		break

if ans:
	print('Yes')
else:
	print('No')

Submission status: Accepted

Solution code:
s = input()
if len(s) % 2 == 1:
    print('No')
    exit()
for i in range(len(s)):
    if i % 2 == 0 and s[i] != 'h':
        print('No')
        exit()
    if i % 2 == 1 and s[i] != 'i':
        print('No')
        exit()
print('Yes')

Submission status: Accepted

Solution code:
S = input()

kouho = ["hi", "hihi", "hihihi", "hihihihi", "hihihihihi"]

if S in kouho:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys

n = input()

i = 0
if len(n) % 2 == 0:
    while True:
        if n[i] == 'h' and n[i+1] == 'i':
            if i == len(n) - 2:
                print('Yes')
                sys.exit()
        else:
            print('No')
            sys.exit()
        i += 2
else:
    print('No')
    sys.exit()

Submission status: Accepted

Solution code:
s = input()

count = len(s) // 2

if s == 'hi' * count:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
S = input()

if len(S) % 2 ==1:
    out = 'No'

else:
    dammy = 'hi' * (len(S)//2)
    if dammy==S:
        out='Yes'
    else:
        out='No'




print(out)

Submission status: Accepted

Solution code:
import numpy as np
import fractions

s=str(input())
if(len(s)%2==1):
    print("No")
    exit(0)
for i in range(len(s)-1):
    if(i%2==0):
        if(s[i]!='h' or s[i+1]!='i'):
            print("No")
            exit(0)
    if(s[i]!='h' and s[i]!='i'):
        print("No")
        exit(0)
if(s[len(s)-1]!='h' and s[len(s)-1]!='i'):
    print("No")
    exit(0)
print("Yes")

Submission status: Accepted

Solution code:
S = input()
HITACHI = "hi"
is_hitachi = True

if len(S)%2 == 0:
  for i in range(len(S)//2):
    if S[2*i:2*i+2] != HITACHI:
      is_hitachi = False
      break
else:
  is_hitachi = False
  
if is_hitachi:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S = input()
cnt = S.count('hi') * 2
if len(S) == cnt:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
from sys import stdin
import math

s = stdin.readline().rstrip()

flag = False
ss = ''
for i in range(10):
    ss += "hi"
    if s == ss:
        flag = True
        break

if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()

if len(s) %2 == 1:
    print('No')
    exit()


for i in range(0,len(s)-1,2):
    if s[i] == 'h' and s[i+1] == 'i':
        continue
    else:
        print('No')
        exit()


print('Yes')

Submission status: Accepted

Solution code:
s = list(input())
if s[::2].count('h') == len(s[::2]) and s[1::2].count('i') == len(s[1::2]) and len(s)%2 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()

if len(S) % 2 != 0:
    print('No')
    exit()

for i in range(len(S)):
    if i % 2 ==0:
        if S[i] != 'h':
            print('No')
            exit()
    else:
        if S[i] != 'i':
            print('No')
            exit()

print('Yes')

Submission status: Accepted

Solution code:
S=input()

pre=S[0]

ans='Yes'

if len(S)%2==1:
    print('No')
else:
    for i in range(len(S)):
        if i%2==0:
            if S[i]!='h':
                ans='No'
        else:
            if S[i]!='i':
                ans='No'
    print(ans)

Submission status: Accepted

Solution code:
def main():
    S = input()

    for i, s in enumerate(S):
        if i % 2 == 0:
            if s == 'h':
                continue
            else:
                print('No')
                exit()
        else:
            if s == 'i':
                continue
            else:
                print('No')
                exit()
    if i % 2 == 0:
        print('No')
    else:
        print('Yes')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()

cnt = 0
for i in range(0, len(s), 2):
    if s[i:i+2] == 'hi':
        cnt += 1

if cnt*2 == len(s):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = list(str(input()))

status = 0
det = 0

for i in range(len(S)):
    if status == 0 and S[i] != "h":
        det = -1
        break
    elif status == 1 and S[i] != "i":
        det = -1
        break
    status += 1
    status %= 2

if det == 0 and status == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=input()
res=""
if s in	("hi", "hihi", "hihihi", "hihihihi", "hihihihihi"):
  res="Yes"
else:
  res="No"
print(res)

Submission status: Accepted

Solution code:
inp = input()
if (inp =="hi" or inp == "hihi" or inp == "hihihi" or inp == "hihihihi" or inp == "hihihihihi"):
    print("Yes")
    
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
length = len(s)

if s == 'hi':
  print("Yes")
else:
  n = length // 2
  if s == 'hi'*n:
    print("Yes")
  else:
    print("No")

Submission status: Accepted

Solution code:
s=input()
ans="Yes"
if len(s)%2==0:
  for i in range(len(s)-1):
    if i%2==0:
      if s[i]!="h" or s[i+1]!="i":
        ans="No"
        break
  print(ans)
else:
  print("No")

Submission status: Accepted

Solution code:
S=input()
if S=='hi':
    print('Yes')
elif S=='hihi':
    print('Yes')
elif S=='hihihi':
    print('Yes')
elif S=='hihihihi':
    print('Yes')
elif S=='hihihihihi':
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
# coding: utf-8
import sys
sys.setrecursionlimit(200000000)


# my functions here!

#入力

def pin(type=int):
    return map(type,input().rstrip().split())

def resolve():
    N=input()
    temp=""
    for i in range(5):
        temp+="hi"
        #print(N,temp)
        if N==temp:
            print("Yes")
            return
    print("No")
    #print([["NA","YYMM"],["MMYY","AMBIGUOUS"]][cMMYY][cYYMM])
#if __name__=="__main__":resolve()

"""
#printデバッグ消した？
#前の問題の結果見てないのに次の問題に行くの？
"""
"""
お前カッコ閉じるの忘れてるだろ
"""
import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """hihi"""
        output = """Yes"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """hi"""
        output = """Yes"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """ha"""
        output = """No"""
        self.assertIO(input, output)

if __name__=="__main__":resolve()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
S = input()
hi_s = "hi"

if len(S)%2!=0:
  print("No")
else:
  flg = 0
  for i in range(int(len(S)/2)):
    if S[(2*i):(2*i+2)]=="hi":
      pass
    else:
      flg = flg + 1

  if flg==0:
    print("Yes")
  else:
    print("No")

Submission status: Accepted

Solution code:
s=input()
t=""
for i in range(5):
    t+="hi"
    if t==s:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
S = input()
l = len(S)
ans = True
if l % 2 != 0:
  ans = False
else:
  for i in range(l):
    if i % 2 == 0 and S[i] == "h": 
      ans = True
    elif i % 2 == 1 and S[i] == "i":
      ans = True
    else:
      ans = False
      break
if ans:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
# coding: utf-8

strings = input().rstrip()
length_strings = len(strings)

correct_strings = "hi" * int(length_strings / 2)

if strings == correct_strings:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
input = input()
n = 2
an = 0
splited = [input[i:i+n] for i in range(0, len(input), n)]
for ahd in splited:
  if splited[an] == "hi":
    an+=1
  else:
    break
if int(an) == int(len(splited)):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S = input()
if len(S) % 2!=0:
    print("No")
else:
    for i in range(6):
        if "hi" * i == S:
            print("Yes")
            exit()
    print("No")

Submission status: Accepted

Solution code:
S = str(input())

S_len = len(S)
half_len = int(len(S)/2)

if S_len%2 != 0:
    print('No')
    exit()

for i in range(half_len):
    if S[2*i:2*i+2] != 'hi':
        print('No')
        exit()

print('Yes')

Submission status: Accepted

Solution code:
S = input()
a = len(S) // 2
if 'hi' * a == S:
    print('Yes')
    exit()
print('No')

Submission status: Accepted

Solution code:
s = input()
k = s.count("hi")
if k==len(s)//2 and len(s)%2==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=input()
a=len(s)//2
if a*2==len(s):
  st="".join(["hi"]*a)
  if st==s:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Accepted

Solution code:
import re

S = input()

pattern = '^(hi)+$'

if re.match(pattern,S):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
flag = False

for i in range(1,6):
    if 'hi' * i == s:
        flag = True

if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
if s == 'hi' or s == 'hihi' or s == 'hihihi' or s == 'hihihihi' or s == 'hihihihihi':
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S=[i for i in input()]
flg = True
while len(S)>=2:
    if S[0]=="h" and S[1]=="i":
        del S[0:2]
    else:
        flg = False
        break
if flg and len(S)==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
n = len(s)
if n % 2 == 1:
    print("No")
    exit()

for i in range(0, n, 2):
    if s[i] != 'h' or s[i+1] != 'i':
        print("No")
        exit()

print("Yes")

Submission status: Accepted

Solution code:
s=input()
a=s.split('hi')
f=0
for i in a:
  if(len(i)>0):
    f=1
    print('No')
    break
if(f==0):
  print('Yes')

Submission status: Accepted

Solution code:
S = str(input())
S = S.replace('hi', "")

if(len(S)==0):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n= str(input())
if len(n)==n.count('hi')*2:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()
#print("S:", S)
while len(S) > 0:
    # vprint("S[:2]", S[:2])
    if S[:2] != 'hi':
        print('No')
        exit()
    S = S[2:]
    # print(":", S)
print('Yes')

Submission status: Accepted

Solution code:
s = input()
if (len(s) == 2 and s == "hi") or (len(s) == 4 and s == "hihi") or (len(s) == 6 and s == "hihihi") or (len(s) == 8 and s == "hihihihi") or (len(s) == 10 and s == "hihihihihi"):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()

print("Yes" if len(s.replace("hi","")) == 0 else "No")

Submission status: Accepted

Solution code:
S = list(input())
N = len(S)

if N%2 == 1:
    print('No')
    exit()
for i in range(0,N,2):
    if S[i] != 'h' or S[i+1] != 'i':
        print('No')
        exit()

print('Yes')

Submission status: Accepted

Solution code:
hitachi = True
s = input()
if(len(s) % 2 != 0):
    hitachi = False
for i in range(0, len(s), 2):
    if(hitachi == False):
        break
    if(s[i] != 'h' or s[i + 1] != 'i'):
        hitachi = False
if(hitachi):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()
l = len(S)
kazu = S.count('hi')
if kazu == l / 2:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def main():
  s=input()
  if s.count('hi')==len(s)//2 and len(s)>=2 and len(s)%2==0:
    print('Yes')
  else:
    print('No')

  
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = raw_input()
if 'hi' in s and s.count('hi')*2 != len(s):
    print "No"
elif 'hi' in s:
    print "Yes"
else:
    print "No"

Submission status: Accepted

Solution code:
S = input()
judge = True
if len(S)%2==1:
  print('No')
  exit()
for i in range(len(S)):
  if i%2==0:
    if S[i]=='h':
      continue
    else:
      judge=False
      break
  else:
    if S[i]=='i':
      continue
    else:
      judge=False
      break
      
if judge:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
S = input()
# Q = int(input())
length = len(S)
ans = "Yes"
for i in range(length):
    if (i % 2 == 0):
        if (S[i] != "h"):
            ans = "No"
    else:
        if (S[i] != "i"):
            ans = "No"
if (length % 2 != 0):
    ans = "No"

print(ans)

Submission status: Accepted

Solution code:
s = input()
t =0 
for s in s:
  if s == "h":
    t=1
  elif s =="i":
    if t == 0:
      t = 0
      print("No")
      quit()
    t = 0
  else:
    print("No")
    quit()
if t == 1:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
ans = ['hi','hi'*2,'hi'*3,'hi'*4,'hi'*5]

w = input()

if w in ans:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S=input()
l=len(S)
T=str("")

for i in range(int(l/2)):
	T+=str("hi")

if S==T:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
s = input()

hi = 'hi'

if s =='hi' or s == 'hihi' or s == 'hihihi' or s == 'hihihihi' or s == 'hihihihihi':
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s=input()
if len(s)%2==1:
    print("No")
    exit()
for i in range(0,len(s),2):
    if s[i] != "h" or s[i+1] != "i":
        print("No")
        exit()
print("Yes")

Submission status: Accepted

Solution code:
S = input()

if len(S.replace("hi","")) == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def main():
    S = input()
    L_S = len(S)

    if L_S % 2 != 0:
        print('No')
        exit()

    for i in range(L_S // 2):
        if S[i * 2] != 'h' or S[i * 2 + 1] != 'i':
            print('No')
            exit()
    print('Yes')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = str(input())

flag = 0
if len(n) % 2 != 0:
    print("No")
else:
    for i in range(int(len(n)//2)):
        if n[i * 2] == "h" and n[i * 2 + 1] == "i":
            flag = 1
        else:
            flag = 0
    if flag == 1:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
import sys

lines = sys.stdin.readlines()
 
text = lines[0]

import re
if re.match(r'^(hi)+$', text):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
a = ["hi", "hihi", "hihihi", "hihihihi", "hihihihihi"]
if s in a:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
flag = 0

if (len(s))%2 == 1:
    print('No')
else:
    for i in range(len(s)):
        if i % 2 == 0:
            if s[i] == 'h':
                pass
            else:
                flag = 1
        else:
            if s[i] == 'i':
                pass
            else:
                flag = 1

    if flag == 0:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
s = input()
a = len(s)//2
if s == "hi"*a:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = list(input())
l = len(S)
if (l % 2 == 0):
    ans = "Yes"
    for i in range(0,l,2):
        if ("".join(S[i:i+2]) != "hi"):
            ans = "No"
    print(ans)
else:
    print("No")

Submission status: Accepted

Solution code:
S=input()
flag=True

if len(S)%2!=0:
  print("No")
else:
  for i in range(len(S)//2):
    if S[2*i]+S[2*i+1]=="hi":
      pass
    else:
      flag=False
      break
      
  if flag:
    print("Yes")
  else:
    print("No")

Submission status: Accepted

Solution code:
s = input()


if s == "hi":
  print("Yes")
elif s == "hihi":
  print("Yes")
elif s == "hihihi":
  print("Yes")
elif s == "hihihihi":
  print("Yes")
elif s == "hihihihihi":
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    S = input()

    l = len(S)
    if l % 2:
        print('No')
        return
    elif l == 2:
        if S != 'hi':
            print('No')
            return

    for i in range(0, l - 2, 2):
        if S[i:i+2] != 'hi':
            print('No')
            break
    else:
        print('Yes')


main()

Submission status: Accepted

Solution code:
S = input()
flag = True
for i in range((len(S)+1)//2):
    if S[2*i:2*i+2] != 'hi':
        flag = False
if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()

if len(s)%2 == 1:
    print("No")
    exit()

if s.count("hi")*2 == len(s):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=input()
if len(s)%2==0:
    for i in range(0,len(s)//2):
        if s[2*i]!="h" or s[2*i+1]!="i":
            print("No")
            break
            
    else:
        print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def main():
    s = input()
    while len(s) > 0:
        c = s[:2]
        # print(c)
        if c != 'hi':
            print('No')
            return
        s = s[2:]
        # print(s)
    print('Yes')
main()

Submission status: Accepted

Solution code:
s = input()

if len(s) % 2:
    print('No')
    exit()

for i in range(0, len(s)-1, 2):
    if s[i] != 'h' or s[i+1] != 'i':
        print('No')
        exit()

print('Yes')

Submission status: Accepted

Solution code:
a = input()
a = a.replace('hi', '')
if len(a) == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
a = "hi"
s = input()
n = 0
for i in range(1,6):
    if a*i==s:
        n = n+1
    else:
        pass
if n>=1:
    print("Yes")
else:
        print("No")

Submission status: Accepted

Solution code:
S = input()
is_hitachi = True
if len(S) %2 == 0:
    for i in range(0, len(S), 2):
        if not (S[i] == 'h' and S[i + 1] == 'i'):
            is_hitachi = False
    print('YNeos'[not is_hitachi::2])
else:
    print('No')

Submission status: Accepted

Solution code:
a = input()
if len(a) % 2 == 1:
  print("No")
else:
  answer = "Yes"
  for i in range(0, len(a), 2):
    if a[i:i+2] != "hi":
      answer = "No"
  print(answer)

Submission status: Accepted

Solution code:
#input
S = input()

# process
result = False
hi = "hi"
s = ""
for i in range(5):
    s += hi
    if S == s:
        result = True
        break

# output
print("Yes" if result else "No")

Submission status: Accepted

Solution code:
h = input()

han = True

while han:
    if len(h) > 1:
        if h[0:2] == "hi":
            
            if len(h) == 2:
                break
            else:
                h = h[2:]
        else:
            han = False

    elif len(h) == 1:
        han = False
    else:
        han = True

if (han):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
c = len(s)
if c % 2 == 1:
  print("No")
  exit()
c //= 2
hi = "hi" * c
if s != hi:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**9)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

s = ns()
s = list(s)

if len(s)%2 == 1:
	print('No')
	exit()

for i in range(0,len(s)//2,2):
	if s[i] != 'h' or s[i+1] != 'i':
		print('No')
		exit()

print('Yes')

Submission status: Accepted

Solution code:
s = str(input())
flag = 0
a = []
if(len(s)%2 != 0):
    print("No")
    exit()
else:
    for i in range(0,len(s),2):
        if(s[i] != "h" or s[i+1] != "i"):
            print("No")
            exit()
print("Yes")

Submission status: Accepted

Solution code:
if input() in ["hi", "hihi", "hihihi", "hihihihi", "hihihihihi"]:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
S = input()

if len(S) < 2:
    print('No')
    exit()

s = S.replace('hi', '')

# print(S)
print('Yes' if len(s) < 1 else 'No')

Submission status: Accepted

Solution code:



inp = input()
ln = len(inp)
if ln%2 or ln==0:
    print('No')

else:
    n = ln//2
    st = 'hi'*n
    if st == inp:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
s=input()
f=True
if len(s)%2==0:
    for i,c in enumerate(s):
        if ("h" if i%2==0 else "i") != c:
            f=False
else:
    f=False
print("Yes" if f else "No")

Submission status: Accepted

Solution code:
a = input()
b = a.split("hi")
c = "".join(b)
if len(c) <= 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
for i in range(10):
    if S[0:2]=="hi":
        S = S[2:]
if len(S) != 0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
s = input()

import re

if re.fullmatch('(hi)+', s):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s = input()
flag = 0
if len(s) % 2 == 1:
  print('No')
else:
  for i in range(len(s)):
    if i % 2 == 0:
      if s[i] == 'h':
        flag += 1
    else:
      if s[i] == 'i':
        flag+= 1
  if flag == len(s):
    print('Yes')
  else:
    print('No')

Submission status: Accepted

Solution code:
H = True
ans = True
for c in input():
    if H and c != "h":
        ans = False
        break
    elif not H and c != "i":
        ans = False
        break
    H = not H

print("Yes" if ans and H else "No")

Submission status: Accepted

Solution code:
s=input()
n=len(s)
for i in range(n):
    if i%2==0 and s[i]!="h":
        print("No")
        break
    if i%2!=0 and s[i]!="i":
        print("No")
        break
else:
    if n%2==0:
        print("Yes")
    else:
        print("No")