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()
if set(S[0::2]) == set('h') and set(S[1::2]) == set('i') and len(S) % 2 == 0:
    ans = True
else:
    ans = False
if ans:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()

isHitachi = True
for i in range((len(S) + 1)//2):
  if S[2*i:2*i+2] != "hi":
    isHitachi =False
    
print("Yes" if isHitachi else "No")

Submission status: Accepted

Solution code:
s=input()
ans=1
if len(s)%2==1:
	ans=0
else:
	i=0
	while i<len(s):
		if s[i:i+2]!="hi":
			ans=0
			break
		i+=2
if ans:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
S = input()
ans = "Yes"
for i in range(0, len(S)-1, 2):
    if S[i] == "h" and S[i+1] == "i":
        continue
    ans = "No"
if len(S)%2 == 1:
    ans = "No"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

##### 累乗 #####
# pow(x, y, z) -> x**y % z

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	S = input()
	S = S[:-1]
	tmp = S.split("hi")

	flg = True
	for i in tmp:
		if i != "":
			flg = False
			break

	if flg == True:
		print("Yes")
	else:
		print("No")
	#print(tmp)

	#print(ans)


#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# special thanks :
#  https://nagiss.hateblo.jp/entry/2019/07/01/185421
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# nCr mod m
# rがn/2に近いと非常に重くなる
def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

# mを法とするaの乗法的逆元
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y

# nHr mod m
# 問題によって、combination()を切り替えること
def H(n, r, mod=10**9+7):
	# comb = Combination(n+r-1, mod)
	# return comb(n+r-1, r)
    return combination(n+r-1, r, mod)

class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  # 10
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        # 階乗のリストと階乗のmod逆元のリストを返す O(n)
        # self.make_modinv_list()が先に実行されている必要がある
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        # 0からnまでのmod逆元のリストを返す O(n)
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv

if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
S = input()

while len(S) > 1:
    if S[0] =='h' and S[1] == 'i':
        S = S[2:]
    else:
        break
if len(S) ==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = str(input())
hi = ""

if len(s) % 2 == 0:
    for i in range(int(len(s)/2)):
        hi = hi + "hi"
    if s == hi:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
s = list(input())

if len(s) % 2 == 1:
    print("No")
    exit()
for i in range(0, len(s) - 1, 2):
    #print(i)
    if not(s[i] == 'h' and s[i + 1] == 'i'):
        print("No")
        exit()
print("Yes")

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict, Counter, deque
from itertools import accumulate, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right, bisect
from heapq import heappop, heappush
from fractions import gcd
from math import ceil, floor, sqrt, cos, sin, pi
from copy import deepcopy

# If you use recursive call, uncomment this code
#sys.setrecursionlimit(10**6)

def main():
    S = input()
    if len(S)%2!=0:
        return "No"
    for i in range(len(S)//2):
        t = i*2
        if S[t:t+2] != "hi":
            return "No"
    return "Yes"

if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re
s = input()
r = re.compile(r"^(hi)+$")
if r.match(s):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys
from collections import deque


def input():
    return sys.stdin.readline()[:-1]


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


if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
s = input()

flag = True
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 len(s) == 1 or len(s) % 2 != 0:
    flag=False

if flag:
    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)):
        if i%2 == 0:
            if s[i] != "h":
                ans = "No"
                break
        else:
            if s[i] != "i":
                ans = "No"
                break
else:
    ans = "No"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

idx = 0
while idx <= len(s)-1:
    st = s[idx] + s[idx+1]
    if st != 'hi':
        print('No')
        exit()
    
    idx += 2
print('Yes')

Submission status: Accepted

Solution code:
S = input()
ans = ""
flag =  0
for i in range(5):
    ans += "hi"
    if ans == S:
        print("Yes")
        flag += 1
        break
if flag == 0:
    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:
# coding: utf-8

s = raw_input()
print ['No', 'Yes'][s in [
    'hi'
    ,'hihi'
    ,'hihihi'
    ,'hihihihi'
    ,'hihihihihi'
    ]]

Submission status: Accepted

Solution code:
S = input()

def hitachi_s(target):
    for i in range(len(target)):
        if i % 2 == 0:
            if target[i:i+2] != "hi":
                return "No"
    return "Yes"

print(hitachi_s(S))

Submission status: Accepted

Solution code:
S = input()
for i in range(1,11):
  if S == 'hi'*i:
    print('Yes')
    exit()
print('No')

Submission status: Accepted

Solution code:
S=raw_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 sys import exit

s = input()

if len(s)%2==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()

v = 'hi'

flg = True

while True:
  if len(s) <= 1:
    if len(s) == 1:
      flg = False
    break
  if s[:2] != v:
    flg = False
    break
  else:
    s = s[2:]

if flg:
  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")
exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
for i in range(1, 6):
    if s == 'hi' * i:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
S = str(input())

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

Submission status: Accepted

Solution code:
s=input()
flag=False
for i in range(1,100):
    if s=="hi"*i:
        flag=True
if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import sys

input = sys.stdin.readline


def main():
    s = input().strip()
    if len(s) % 2 == 1:
        print('No')
        return

    for idx in range(len(s)):
        if idx % 2 == 0 and s[idx] != 'h':
            print('No')
            return
        elif idx % 2 == 1 and s[idx] != 'i':
            print('No')
            return
    print('Yes')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()

prev = 'i'
for s in S:
    if s == 'h' and prev == 'i':
        pass
    elif s == 'i' and prev == 'h':
        pass
    else:
        print('No')
        break
    prev = s
else:
    if prev == "h":
        print('No')
    else:
        print('Yes')

Submission status: Accepted

Solution code:
S = input()

for i in range(0,len(S),2):
  if not S[i:i+2] == 'hi':
    print('No')
    exit(0)

print('Yes')

Submission status: Accepted

Solution code:
S = input()

if len(S) % 2 != 0:
    print("No")
else:
    i,flag = 0,True
    while i+1 <= len(S):
        if S[i] == "h" and S[i+1] == "i":
            i += 2
        else:
            flag = False
            break
    if flag:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

if s == "":
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S = list(input())

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

i = 0
while i < len(S):
    if S[i] == 'h' and S[i+1] == 'i':
        i += 2
    else:
        print("No")
        exit()

print("Yes")

Submission status: Accepted

Solution code:
def main():
    import sys
    #input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations
    #from itertools import accumulate, product
    from bisect import bisect_left,bisect_right
    from math import floor, ceil
    #from operator import itemgetter

    #mod = 1000000007

    s = list(input())
    a = len(s)
    if a%2==1:
        print('No')
        exit()
    for i, x in enumerate(s):
        if i%2==0:
            if x!='h':
                print('No')
                exit()
        else:
            if x!='i':
                print('No')
                exit()
    print('Yes')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = str(input())

if len(s) % 2 != 0:
    ans = ' No'
else:
    ans = 'Yes'
    for i in range(0, len(s), 2):
        if s[i] == 'h' and s[i+1] == 'i':
            pass
        else:
            ans = 'No'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def main():
    s = input()

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
hitachi = ["hi", "hihi", "hihihi", "hihihihi", "hihihihihi"]
S = input()
if S in hitachi:
    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):
    ans = S.split('hi')
    for c in ans:
        if c != '':
            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()

s_length = len(S)


if S == "hi" * int(s_length/2):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = list(input())
ans = 'Yes'

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

Submission status: Accepted

Solution code:
S = input()
i = 0
while(i<len(S)):
  if i+1 < len(S) and S[i] == 'h' and S[i+1] == 'i':
    i += 2
  else:
    print('No')
    exit()
print('Yes')

Submission status: Accepted

Solution code:
import sys
import math
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass
s = l()
c = 0
d = 0
for i in range(len(s)):
    if i%2 == 0 and s[i] == "h":
        c += 1
    else:
        if s[i] == "i":
            d += 1
print("Yes" if c == d and len(s) == c+d else "No")

Submission status: Accepted

Solution code:
s = input()
if len(s)%2==1:
  print('No')
else:
  if s == 'hi'*(len(s)//2):
    print('Yes')
  else:
    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:
def main():
    S = input()
    hi = 'hi'
    for i in range(1,6):
        if S == hi*i:
            print('Yes')
            return
    print('No')
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s1=str(input())
ns1=s1.replace("hi","")

if ns1=="":
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = str(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':
        continue
    else:
        print("No")
        exit()
print("Yes")
# n = int(input())
# ans = 0

# for i in range(n):
#     print(i)


# print(ans)

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 = list(input())
for i, x in enumerate(s):
    if (i % 2 and x != "i") or (i % 2 == 0 and x != "h"):
        print("No"); break
else:
    print("Yes" if len(s) % 2 == 0 else "No")

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
x = input()
y=0
if len(x) % 2 == 1:
    y = 1
    
for i in range(len(x)):
    if i % 2 == 0 :
        if x[i] != 'h':
            y=1
            break
    elif i % 2 ==1:
        if x[i] != 'i':
            y=1
            break

if y ==0:
    print("Yes")
elif y ==1:
    print("No")

Submission status: Accepted

Solution code:
import re
S = str(input())
pattern = '^(hi)+$'

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

Submission status: Accepted

Solution code:
S = input()
N = len(S)
out = "Yes"
if N%2==1:
    print("No")
else:
    for i in range(0,int(N//2)):
        if (S[2*i]=="h")and(S[2*i+1]=="i"):
            continue
        else:
            out = "No"
    print(out)

Submission status: Accepted

Solution code:
s = input()

if len(s)%2 == 1:
  print('No')
else:
  n = int(len(s)/2)
  if s == 'hi'*n:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
hi = "hi"
for i in range(1, 10):
  if (s == hi*i):
    print("Yes")
    exit()
print("No")

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    from sys import stdin
    input = stdin.readline

    s = input()[:-1]
    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 -*-
S = input()
# 出力
# 奇数を取得
if (len(S) % 2 == 1):
    print('No')
    exit()
for i in range(0, len(S), 2):
    if (S[i] + S[i + 1] == 'hi'):
        continue
    else:
        print('No')
        exit()
print('Yes')

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()
S = S.replace("hi", "")
if S:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
S = list(input())

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

Submission status: Accepted

Solution code:
S = input()

ans = 'Yes'
buf = S
while buf:
    if len(buf) < 2 or not 'hi' in buf[-2:]:
        ans = 'No'
        break
    buf = buf[0:-2]

print(ans)

Submission status: Accepted

Solution code:
string = input()
flg = True
if len(string)  == 0:
  flg = False
if len(string) % 2 != 0:
  flg = False
for i in range(len(string)//2):
  if string[i*2:i*2+2] != 'hi':
    flg = False
    break
    
if flg:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
def hitachi(S):
  i = 0
  while i < len(S):
    if S[i:i+2]!='hi':
      return('No')
    i+=2
  return('Yes')

print(hitachi(S))

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:
print(["No","Yes"][input() in ["hi" * x for x in range(1,6)]])

Submission status: Accepted

Solution code:
s = input()
cant = 1
for i in range(1, 6):
        if "hi"*i==s: cant = 0
print("YNeos"[cant::2])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
jdg = False
for i in range(1,6):
    if S == "hi"*i:
        jdg = True
if jdg:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
li = list(s)
if (len(s)%2==0):
    for i in range(0,len(s),2):
        a = li[i] + li[i+1]
        if (a!="hi"):
            print("No")
            break
    else:
        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()

if len(S) % 2 != 0:
    print('No')
else:
    a = S.count('hi')
    if a == len(S) // 2:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read()[:-1] for _ in range(H)]


def read_map_as_int(H):
    '''
    #→1,.→0として読み込む
    '''
    ret = []
    for _ in range(H):
        ret.append([1 if s == '#' else 0 for s in read()[:-1]])
        # 内包表記はpypyでは若干遅いことに注意
        # #numpy使うだろうからこれを残しておくけど
    return ret


# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from fractions import gcd


def lcm(a, b):
    # 最小公約数
    g = gcd(a, b)
    return a * b // g


S = read()[:-1]
if len(S) < 2 or len(S) & 1 == 1:
    print('No')
    exit()
hi = 'hi'
for s, ss in zip(S[::2], S[1::2]):
    if hi != s + ss:
        print('No')
        exit()

print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
s_len = len(s)
s_len = int(s_len / 2)
hi_str = "hi"
new_s = hi_str * s_len
if s == new_s:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = [s for s in input()]
h = 'hi'
if len(S)%2 != 0:
    print('No')
    exit()
flag = 1
while S:
    if len(S) >= 2:
        s1 = S.pop(0)
        s2 = S.pop(0)
        tmp = s1+s2
        if tmp == h:
            continue
        else:
            flag = 0
if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s= input()
if len(s)%2!=0:
    print('No')
else:
    no= False
    while(len(s)>0 and not no):
        if s[:2]!='hi':
            no=True
            break
        s=s[2:]
    if no:
        print('No')
    else:
        print('Yes')

Submission status: Accepted

Solution code:
def main(s):
    if len(s) % 2 == 1:
        return 'No'
    else:
        p = int(len(s)/2)
        for i in range(p):
            if s[2*i] != 'h' or s[2*i+1] != 'i':
                return 'No'
        return 'Yes'
s = input()
print(main(s))

Submission status: Accepted

Solution code:
s=input()

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:
        print('No')
        exit()
if s[-1] == 'i':
    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:
S = input()

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

Submission status: Accepted

Solution code:
import sys
s = input()
def hitachi(s):
  n = len(s)
  if n % 2 != 0:
    return False
  for i in range(0, n, 2):
      if s[i] != 'h' or s[i + 1] != 'i':
          return False
  return True

if hitachi(s):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s = 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')
            break
    else:
        print('Yes')

Submission status: Accepted

Solution code:
import re;print("YNeos"[re.match(r"^(hi)+$" ,input())==None::2])

Submission status: Accepted

Solution code:
def inpl():
    return list(map(int, input().split()))


S = input()

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

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()
hitachi = ['hi'*i for i in range(1,6)]
if S in hitachi:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
for i in range(1, 6):
    if s == 'hi' * i:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

ans = "No"
if s == "hi":
    ans = "Yes"
elif s == "hihi":
    ans = "Yes"
elif s == "hihihi":
    ans = "Yes"
elif s == "hihihihi":
    ans = "Yes"
elif s == "hihihihihi":
    ans = "Yes"

print(ans)

Submission status: Accepted

Solution code:
import sys
s = input()

i = 0
while True:
    if s[i:i+2] != 'hi':
        print('No')
        sys.exit()
    i += 2
    if i >= len(s):
        break

print('Yes')

Submission status: Accepted

Solution code:
s=input()
if(len(s)%2==1):
    print("No")
else:
    kano=True
    for i in range(len(s)//2):
        if(s[i*2:i*2+2]!="hi"):
            kano=False
            break
    if(kano):
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
S=input()

answer="Yes"

for i in range(len(S)//2):
    if S[2*i:2*(i+1)]=="hi":
        pass
    else:
        answer="No"
        break
if len(S)%2==1:
    answer="No"

print(answer)

Submission status: Accepted

Solution code:
# coding: utf-8


def solve(*args: str) -> str:
    s = args[0]

    ret = True
    for i in range(0, len(s), 2):
        ret &= s[i:i+2] == 'hi'
    return 'Yes' if ret else 'No'


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Submission status: Accepted

Solution code:
# A
S = input()

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

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

Submission status: Accepted

Solution code:
def resolve():
    S = input()
    for i in range(0, len(S), 2):
        if S[i:i+2] != 'hi':
            print("No")
            return

    print("Yes")
        

if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
s=input()

tog=True
for i in s:
    if tog:
        if i!="h":
            print("No")
            exit(0)
    else:
        if i!="i":
            print("No")
            exit(0)
    tog=not tog

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
#input
s = input()
for i in range(1,6):
    if s == "hi"*i:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
import sys

def load(vtype=int):
    return vtype(input().strip())


def load_list(seplator=" ", vtype=int):
    return [vtype(v) for v in input().strip().split(seplator)]

s = load(str)    


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

n = int(len(s) / 2)

target = 'hi' * n

if target == s:
    print('Yes')
    sys.exit(0)
print('No')