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:
# h, n, *L = map(int, open(0).read().split())
# a = map(int, input().split())
# i = int(input())
# a = [map(int, input().split()) for _ in range(i)]
# print(list(a))

# [(a,b) for a, b in zip(*[iter(L)] * 2)]


s = input()

ans = "Yes"
if len(s) % 2 != 0:
    print("No")
    exit()

for i in range(0, len(s) - 1, 2):
    str = s[i] + s[i + 1]
    if str == 'hi':
        continue
    ans = "No"

print(ans)

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-

def solve():
    S = input()
    hi = "hi"
    s = S.split(hi)
    for x in s:
        if x == "":
            continue
        else:
            print("No")
            return
    print("Yes")


if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
a=input()
if 'hi'*5==a:
    print('Yes')
elif 'hi'*4==a:
    print('Yes')
elif 'hi'*3==a:
    print('Yes')
elif 'hi'*2==a:
    print('Yes')
elif 'hi' == a:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = str(input())

if len(S)%2 == 0:
  tes = "hi"*int((len(S)/2))
  if S ==tes:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Accepted

Solution code:
S = input()
b = True

if len(S)%2!=0:
	b = False

for i in range(1, len(S), 2):
	if S[i-1] == 'h':
		if S[i] == 'i':
			continue
	b = False

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

Submission status: Accepted

Solution code:
S=input()
L0=len(S)
C=0
if L0 % 2 == 0:
    for i in range(int(L0 / 2)):
        if (S[i*2:i*2+2] == "hi"):
            C=1
if C==1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=list(input())
hcheck=0
hicheck=0
for t in s:
    if t=='h':
        hicheck=0
        hcheck=1
    elif t=='i' and hcheck==1:
        hicheck=1
        hcheck=0
    else:
        hicheck=0
        hcheck=0
        break

if hicheck==1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
ans = "No"
if len(S) % 2 == 0:
    if S == ("hi" * (len(S) // 2)):
        ans = "Yes"


print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
ans = 'No'
t = ''

for i in range(5):
  t = t + 'hi'
  if s == t:
    ans = 'Yes'

print(ans)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
S = input()

for i in range(6):
    if S == 'hi'*i:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
S = input()

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

for i in range(len(S)):
    if i%2 == 0 and S[i] == "h":
        pass
    elif i%2 == 1 and S[i] == "i":
        pass
    else:
        print("No")
        sys.exit()
print("Yes")

Submission status: Accepted

Solution code:
s = input()
si = 'hi'
if s.replace(si, '').strip() == "":
    if len(s) != 0:
        print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str

def solve(S: str):
    length = len(S)
    if length % 2 != 0:
        print(NO)
        return
    
    for i in range(length):
        if i % 2 == 0 and S[i] != "h":
            print(NO)
            return
        elif i % 2 != 0 and S[i] != "i":
            print(NO)
            return

    print(YES)

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()
flg = False

num = len(S)
if num == 2 and S == 'hi':
    flg = True
if num == 4 and S == 'hihi':
    flg = True
if num == 6 and S == 'hihihi':
    flg = True
if num == 8 and S == 'hihihihi':
    flg = True
if num == 10 and S == 'hihihihihi':
    flg = True

if flg == True:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#def main(S, b):

if __name__ == '__main__':
    s = input()
    flag = 1
    while (len(s) > 0):
        if (s[:2] == "hi"):
            s = s[2:]
        else:
            flag = 0
            s = ""
    if (flag):
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
s = input()

ans = True

while len(s) > 0:
    if len(s) == 1:
        print('No')
        exit(0)
    if s[0] == 'h' and s[1] == 'i':
        s = s[2:]
    else:
        ans = False
        break

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

Submission status: Accepted

Solution code:
import sys
s = input()

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

for i in range(0,len(s),2):
    if s[i:i+2] == "hi":
        pass
    else:
        print("No")
        sys.exit()
print("Yes")

Submission status: Accepted

Solution code:
#At coder 2020/3/9 A
#import math
#import time
S=input()
#Q=int(input())

ans='No'
if len(S)%2==0:
    #print(len(S)/2)
    for ii in range(int(len(S)/2)):
        if S[2*ii]=='h' and S[2*ii+1]=='i':
            ans='Yes'
        else:
            ans='No'
            break

    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
hitachi = 'hi'
i = 1
 
while True:
    corect = hitachi * i
    if S == corect:
        print('Yes')
        break
    i += 1
    if i == 20:
        print('No')
        break

Submission status: Accepted

Solution code:
import sys
import math
import collections
from collections import deque
#n = int(input())
#a, b = map(int, sys.stdin.readline().split())
s = input()
#x = sys.stdin.readline().split()

if len(s) % 2 != 0:
    print("No")
    sys.exit()


for i in range(int(len(s)/2)):
    if s[2 * i] == "h" and s[2 * i + 1] == "i":
        continue
    else:
        print("No")
        sys.exit()

print("Yes")

Submission status: Accepted

Solution code:
s = input()
k = ""
for i in range(len(s)//2):
  k += "hi"
if s == k:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys
s = str(input())
a = 0
if len(s) == 1:
    print('No')
    sys.exit()
for i in range(len(s) - 1):
    if s[i] == 'h' and s[i + 1] == 'i':
        a += 1
if len(s) % 2 == 0:
    if a == len(s) // 2:
        print('Yes')
        sys.exit()
    else:
        print('No')
        sys.exit()
else:
     print('No')

Submission status: Accepted

Solution code:
import re

def resolve():
    str = input()
    if re.match('^(hi)+$', str):
        print("Yes")
    else:
        print("No")
        
resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
n = len(S)
s = "hi" * (n // 2)

if n % 2 == 0 and s == S:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
n = len(s)
pr =s[0]
ls = ["h","i"]
cnt = 0
for i in range(n):
    pr = s[i]
    if pr == ls[cnt]:
        pass
        cnt = (cnt+1)%2
    else:
        print("No")
        exit()
if pr == "i":
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(S: str):
    if len(S) % 2 == 1:
        print(NO)
        exit()
    n = 0
    while n != len(S):
        if S[n] == "h" and S[n+1] == "i":
            n += 2
        else:
            break
    if n == len(S):
        print(YES)
    else:
        print(NO)


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s=input()
if len(s)%2!=0:
  print('No')
  exit()
else:
  if s=='hi':
    print('Yes')
    exit()
  if s=='hihi':
    print('Yes')
    exit()
  if s=='hihihi':
    print('Yes')
    exit()
  if s=='hihihihi':
    print('Yes')
    exit()
  if s=='hihihihihi':
    print('Yes')
    exit()
  else:
    print('No')

Submission status: Accepted

Solution code:
s = input().rstrip()

for i in range(1, 6):
    if s == "hi" * i:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
S = str(input())

flag = False
if len(S) % 2 == 1:
    flag = False
else:
    for count in range(int(len(S)/2)):
        if S[count*2] != "h" or S[count*2 + 1] != "i":
            flag = False
            break
        else:
            flag = True

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
 
s = input()
if len(s) % 2 != 0:
  print('No')
  sys.exit()
 
for i in range(0,len(s),2):
  if s[i:(i+2)] != 'hi':
    print('No')
    sys.exit()
    
print('Yes')

Submission status: Accepted

Solution code:
import sys

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

n = 0
for i in range(int(len(s)/2)):
  if(s[n] != "h" or s[n + 1] != "i"):
    print("No")
    sys.exit()
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
n=len(S)
if n==2:
  if S=='hi':
    print('Yes')
  else:
    print('No')
elif n==4:
  if S=='hihi':
    print('Yes')
  else:
    print('No')
elif n==6:
  if S=='hihihi':
    print('Yes')
  else:
    print('No')
elif n==8:
  if S=='hihihihi':
    print('Yes')
  else:
    print('No')
elif n==10:
  if S=='hihihihihi':
    print('Yes')
  else:
    print('No')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(S: str):

    if (len(S)%2 != 0):
        print(NO)
    
    else:
        for x in range(len(S)//2):
            if S[2*x:2*x+2] != "hi":
                print(NO)
                return
    
        print(YES)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()
ans = 'No'
 
if len(S)%2 == 0:
    for i in range(len(S)//2):
        if S[2*i] + S[2*i+1] != 'hi':
            break
        elif i == (len(S)//2)-1:
            ans = 'Yes'
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Mar  8 20:59:57 2020

@author: naoki
"""
import sys
string = str(input())

if ("hhii") in string:
    print("No")
    sys.exit()

while "hi" in string:
    place = string.index("hi")
    string = list(string)
    del string[place]
    del string[place]
    string = ''.join(str(n) for n in string)

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

Submission status: Accepted

Solution code:
S = input()
l = [S[i : i + 2] for i in range(0, len(S), 2)]
for s in l:
  if s != "hi":
    print("No")
    exit()
print("Yes")

Submission status: Accepted

Solution code:
s = input()

hi = True
for i in range(len(s)):
  if i % 2 == 0 and s[i] != "h":
    hi = False
    break
  elif i % 2 == 1 and s[i] != "i":
    hi = False
    break
    
if len(s) % 2 != 0:
  hi = False
  
if hi:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
def main():
  S = str(input())
  
  Hi_S = []
  ex = ''
  for i in range(5):
    ex += 'hi'
    Hi_S.append(ex)

  for i in Hi_S:
    if S == i:
      print('Yes')
      exit()
    else:
      pass

  print('No')

if __name__ == "__main__":
  main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
flag = 0

if len(s)%2 == 1:
    flag = 1
for i in range(len(s)//2):
    if s[2*i] == 'h' and s[2*i+1] == 'i':
        continue
    else:
        flag = 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline

S = input()
ans = 'No'
for i in range(1, 8):
    if S == 'hi'*i:
        ans = 'Yes'

print(ans)

Submission status: Accepted

Solution code:
import re
s = input()
isHitachi = re.search("^(hi)+$", s)
if isHitachi:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys
#input = sys.stdin.readline
S=input()
if len(S)%2==1:
    print("No")
    exit()
ans=[]
count =0 
for i in range(len(S)):
    ans.append(S[i])
#print(ans)
while len(ans)>1:
    if ans[0]+ans[1]=="hi":
        ans.pop(0)
        ans.pop(0)
    else:
        print("No")
        exit()
    #print(ans)
print("Yes")

Submission status: Accepted

Solution code:
#n = int(input())
s = input()
#a,b = map(int,input().split())
#a_L = list(map(int,input().split()))

if s == "hi":
    print("Yes")
    exit()
s = s.split("hi")
for i in s:
    if i != "":
        print("No")
        exit()
print("Yes")
# if len(s) != 1:
#     print("Yes")
# else:
#     print("No")

Submission status: Accepted

Solution code:
S = input()

leng = len(S) // 2
ans = 'hi' * leng

print('Yes' if S == ans else 'No')

Submission status: Accepted

Solution code:
value = input()
count = len(value)
hitachi = ['hi', 'hihi', 'hihihi', 'hihihihi', 'hihihihihi']

if count % 2 != 0:
  print('No')
else:
  if value in hitachi:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

Solution code:
# coding: utf-8
S=list(input())
flg=True

for i in range(len(S)):
    if i%2==0:
        if S[i]!="h":
            flg=False
    else:
        if S[i]!="i":
            flg=False
if len(S)%2==1:
    flg=False

if flg:
    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:
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


def main():
    S = input()[:-1]
    tmp = "hi"
    for _ in range(len(S)):
        if S == tmp:
            print("Yes")
            return
        tmp += "hi"
        if len(tmp) > len(S):
            break
    print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()
if s == "hi" or s == "hi"*2 or s == "hi"*3 or s == "hi"*4 or s == "hi"*5:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
if len(s) % 2 != 0:
    print("No")
    exit()
else:
    S = [s[i] + s[i+1] for i in range(0, len(s), 2)]
    sS = list(set(S))
    if len(sS) == 1 and sS[0] == "hi":
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
S=str(input()) 


if len(S) % 2 != 0:
    print('No')
else:
    for i in range(len(S)//2):
        if S[i*2:i*2+2] != 'hi':
            print('No')
            exit()
        
        
    print('Yes')

Submission status: Accepted

Solution code:
# S = input()
# if len(S) % 2 == 1:
#     print('No')
#     exit()
# else:
#     if S[0] != "h":
#         print('No')
#         exit()
#     for i in range(len(S)-1):
#         flag = True
#         if S[i] == "i":
#             if S[i-1] != "h":
#                 flag = False
#         elif S[i] == "h":
#             if S[i-1] != "i":
#                 flag = False
#         else:
#             flag = False
# if flag:
#     print('Yes')
# else:
#     print('No')

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

Submission status: Accepted

Solution code:
s = str(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=str(input())
k=len(S)
ans="Yes"
if k%2==0:
    for i in range(k//2):
        t=S[2*i:2*i+2:1]
        if t=="hi":
            continue
        else:
            ans="No"
            break
else:
    ans="No"
print(ans)

Submission status: Accepted

Solution code:
str = input()

a = str.replace('hi', '')
#print(a)

if len(a) > 0:
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
import sys
s=list(input())

if len(s)%2!=0:
    print("No")
    sys.exit()
f=True
for i in range(len(s)//2):
    l=i*2
    if s[l]!="h" or s[l+1]!="i":
        f=False
if f:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()

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

if S[len(S) - 2] == "h" and S[len(S) - 1] == "i":
    print("Yes")
    exit()

print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re

s = input()

match = re.match(r"^(hi)+$", s)

result = "Yes" if match else "No"

print(result)

Submission status: Accepted

Solution code:
import re

str_ = input()
pattern = "hi"

results = re.sub(pattern, "", str_)

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

Submission status: Accepted

Solution code:
s = input()
next_word = 'h'
is_correct = False

for word in s:
    if word != next_word:
        print('No')
        exit()
    elif word == next_word:
        if next_word == 'h':
            next_word = 'i'
            is_correct = False
        elif next_word == 'i':
            next_word = 'h'
            is_correct = True

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

Submission status: Accepted

Solution code:
S = input()

if len(S)<=10 and len(S)>=1:
    if (("hi" in S)and(len(S)==2))or(("hihi" in S)and(len(S)==4))or(("hihihi" in S)and(len(S)==6))or(("hihihihi" in S) and (len(S)==8))or(("hihihihihi" in S) and (len(S)==10)):
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
# from fractions import gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    S = INPUT()

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()

while S.find("hi") == 0:
    S = S[2:]

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

Submission status: Accepted

Solution code:
s = input()
f = 1
if len(s) % 2:
    f = 0
else:
    for h in s[::2]:
        if h != 'h':
            f = 0

    for i in s[1::2]:
        if i != 'i':
            f = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()
import re
n2 = re.split('(..)',n)[1::2]


if len(n) % 2 != 0:
    print('No')
else: 
    cnt = 0
    for i,s in enumerate(n2):
        if 'hi' in s:
            cnt += 1
    if cnt == len(n2):
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/env python

def main():
    s = list(input())
    n = len(s)

    chk = 1
    if n % 2 == 0:
        for i in range(n):
            if i % 2 == 0:
                if s[i] != 'h':
                    chk = 0
                    break
            else:
                if s[i] != 'i':
                    chk = 0
                    break
    else:
        chk = 0

    if chk == 1:
        print('Yes')
    elif chk == 0:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from fractions import gcd
# from datetime import date, timedelta
# from heapq import *
import heapq
import math
from collections import defaultdict, Counter, deque
from bisect import *
import itertools
import fractions
import sys
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
# input = sys.stdin.readline


# def lcm(a, b):
#     return a * b / fractions.gcd(a, b)


# def make_divisors(n):
#     divisors = []
#     for i in range(1, int(n**0.5)+1):
#         if n % i == 0:
#             divisors.append(i)
#             if i != n // i:
#                 divisors.append(n//i)

#     # divisors.sort()
#     return divisors


# def factorize(n):
#     fct = []  # prime factor
#     b, e = 2, 0  # base, exponent
#     while b * b <= n:
#         while n % b == 0:
#             n = n // b
#             e = e + 1
#         if e > 0:
#             fct.append((b, e))
#         b, e = b + 1, 0
#     if n > 1:
#         fct.append((n, 1))
#     return fct


# def is_prime(n):
#     if n == 1:
#         return False

#     for k in range(2, int(math.sqrt(n)) + 1):
#         if n % k == 0:
#             return False

#     return True


# def primes(n):
#     is_prime = [True] * (n + 1)
#     is_prime[0] = False
#     is_prime[1] = False
#     for i in range(2, int(n**0.5) + 1):
#         if not is_prime[i]:
#             continue
#         for j in range(i * 2, n + 1, i):
#             is_prime[j] = False
#     return [i for i in range(n + 1) if is_prime[i]]

# def modpow(a, n, mod):
#     res = 1
#     while n > 0:
#         if n & 1:
#             res = res * a % mod
#         a = a * a % mod
#         n >>= 1
#     return res


# def modinv(a, mod):
#     return modpow(a, mod - 2, mod)


# def cnk(a, b):
#     MOD = 10**9+7
#     ret = 1
#     for i in range(b):
#         ret *= (a-i)
#         ret %= MOD
#         ret = ret * modinv(i+1, MOD) % MOD
#     return ret


# class UnionFind:
#     def __init__(self, n):
#         self.sz = [-1 for i in range(n)]

#     # 検索
#     def find(self, x):
#         if self.sz[x] < 0:
#             return x
#         else:
#             self.sz[x] = self.find(self.sz[x])
#             return self.sz[x]

#     # 併合
#     def union(self, x, y):
#         x = self.find(x)
#         y = self.find(y)
#         if x == y:
#             return False
#         if self.sz[x] > self.sz[y]:
#             x, y = y, x
#         self.sz[x] += self.sz[y]
#         self.sz[y] = x

#     # 同じ集合に属するか判定
#     def same(self, x, y):
#         return self.find(x) == self.find(y)

#     # xが含まれている集合のサイズを求める
#     def size(self, x):
#         return -self.sz[self.find(x)]


def main():
    s = input()
    if (len(s)) % 2 == 1:
        print("No")
        exit()
    for i in range(0 , len(s),2):
        if s[i] == "h" and s[i + 1] == "i":
            pass
        else:
            print("No")
            exit()


    print("Yes")
  


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from math import floor
s = input()
lens = len(s)
if s == "hi" * floor(lens/2):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
s=input()
l=len(s)
if l%2==1:
  print('No')
  sys.exit()
for i in range(0,l,2):
  if s[i]=='h':
    if s[i+1]!='i':
      print('No')
      sys.exit()
  else:
    print('No')
    sys.exit()
print('Yes')

Submission status: Accepted

Solution code:
S = list(input())
res = 'Yes'
if len(S)%2 == 0:
  for i in range(int(len(S)/2)):
    if S[2*i] == 'h' and S[2*i+1] == 'i':
      res = 'Yes'
    else:
      res = 'No'
      break
else:
  res = 'No'

print(res)

Submission status: Accepted

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

import sys

s=input()

l = len(s)

if (l % 2 != 0):
    print('No')
    sys.exit()

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

print('Yes')

Submission status: Accepted

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

if n%2==1:
    print("No")
else:
    for i in range(0,n,2):
        if s[i]=="h" and s[i+1]=="i":
            if i==n-2:
                print("Yes")
            else:
                continue
        else:
            print("No")
            break

Submission status: Accepted

Solution code:
def a():
    import re

    S = input()
    pattern = '^(hi)+$'

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


##########
if __name__ == "__main__":
    a()

Submission status: Accepted

Solution code:
S= input()

if len(S) %2 != 0:
  print('No')
  exit()
number = len(S)//2
if 'hi'*number == S:
  print('Yes')
  exit()
print('No')

Submission status: Accepted

Solution code:
S = input()
if S == 'hi' or S =='hihi' or S == 'hihihi' 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 in range(len(s)//2):
  if (s[i*2] != "h") | (s[i*2+1] != "i"):
    flag = False

if (flag == True) & (len(s)%2==0):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re 

c = input()
res = c.replace('hi', '')
if res == '':
    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:
# -*- coding: utf-8 -*-
s = input()
ret = 'Yes'
if len(s) % 2 == 1:
    ret = 'No'
else:
    for i in range(len(s)):
        if i % 2 == 0 and s[i] == 'h': continue
        elif i % 2 == 1 and s[i] == 'i': continue
        else:
            ret = 'No'
            break
print(ret)

Submission status: Accepted

Solution code:
s = input()

ans = True
for i in range(0, len(s)-1, 2):
  if s[i] + s[i+1] != 'hi':
    ans = False
    
if len(s) % 2 == 1:
  ans = False

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

Submission status: Accepted

Solution code:
import re
s = input()
ans = 'Yes'
s = re.split('(..)', s)[1::]
s = [x for x in s if x != '']
for c in s:
    if c == 'hi': continue
    ans = 'No'
    break
if len(s) == 0: ans = 'No'
print(ans)

Submission status: Accepted

Solution code:
def main(): 
    s=list(input())

    if not len(s)%2 == 0:
        print('No')
        return

    for i in range(len(s)):
        if i%2 == 0:
            if not s[i] == "h":
                print('No')
                return
        else:
            if not s[i] == "i":
                print('No')
                return
    
    print('Yes')

main()

Submission status: Accepted

Solution code:
str_hi = input()
hi_num = int(len(str_hi) / 2)

if "hi" * hi_num == str_hi:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import re
strin=input()
pattern = '(hi)+$'
if re.match(pattern, strin):
    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" or s =="hihihihihihihi" or s =="hihihihihihihihi" or s =="hihihihihihihihihi" or s =="hihihihihihihihihihi":
    print("Yes")
else:
    print("No")