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:
#A
#入力
S=input()
#処理
t=0
for i in range(5):
    if S=="hi"*(i+1) :
        t=1
        print("Yes")
        break
if t==0:
    print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
#import numpy as np
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
#N = int(input())
#S = str(input())

S = str(input())

if len(S)%2 == 1 :
  print ("No")
  exit()
else :
  c = len(S)//2
  st = ""
  for _ in range(c) :
    st += "hi"
  if S == st :
    print ("Yes")
  else :
    print ("No")

Submission status: Accepted

Solution code:
S=input()
c = 0
def judge(S):
    c = 0
    if len(S)==1:
        return 'No'
    for i in range(len(S)):
        if i%2==0:
            if S[i] =='h':
                c += 1
            else:
                return 'No'
        else:
            if S[i] =='i':
                c -=1
            else:
                return 'No'
    if c==0:
        return 'Yes'
    else:
        return 'No'
print(judge(S))

Submission status: Accepted

Solution code:
s = input()
r = 'Yes'
while s:
    if s[:2] == 'hi':
        s = s[2:]
    else:
        r = 'No'
        break
print(r)

Submission status: Accepted

Solution code:
# A - Hitachi String
import sys
def input(): return sys.stdin.readline().rstrip()
S = input()
rule = ['hi', 'hihi','hihihi','hihihihi','hihihihihi']
print('Yes' if S in rule else 'No')

Submission status: Accepted

Solution code:
s = input().replace("hi",'1')
for a in s:
  if a != '1':
    print("No")
    exit()
print("Yes")

Submission status: Accepted

Solution code:
N = input()
end = False

if len(N)%2 == 1:
  print("No")
  end = True

else:
  for i in range(len(N)):
    if i % 2 == 0:
      if N[i]!="h":
        print("No")
        end = True
        break
    else:
      if N[i] !="i":
        print("No")
        end = True
        break
        
if not end:
  print("Yes")

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s = input()

S = s.split("hi")

if set(S) == {''}:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=input()
s0=[x=='h' for i,x in enumerate(s) if i%2==0]
s1=[x=='i' for i,x in enumerate(s) if i%2==1]
if len(s)%2==0 and all(s0) and all(s1):
  print('Yes')
else:
  print('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
if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

S = input()

mypos = 0

while mypos < len(S):
    if S[mypos:mypos+2] == 'hi':
        mypos += 2
    else:
        print('No')
        sys.exit()
    
print('Yes')

Submission status: Accepted

Solution code:
s = input()
l = s[0::2]
m = s[1::2]
if set(l) == {'h'} and set(m) == {'i'} and len(s)%2==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = list(input())
c = 0
ans = 0
if len(s) == 1 and s[0] == "h":
    print("No")
elif s[-1] != "i":
    print("No")
else:
    for i in range(len(s)):
        if s[i] == "h" and c == 0:
            c = 1
            ans += 1
        elif s[i] == "i" and c == 1:
            c = 0
            ans += 1

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

Submission status: Accepted

Solution code:
s = input()

if len(s) %2 == 1:
  print("No")
  exit()
elif len(s)%2 ==0:
  num=0
  for i in range(0,len(s),2):
    if s[i] == "h":
      num +=1
    if s[i+1] =="i":
      num +=1
      
  if num ==len(s):
    print("Yes")
    exit()
    
print("No")

Submission status: Accepted

Solution code:
#import sys
MOD = 10 ** 9 + 7
INFI = 10**10
#input = sys.stdin.readline
import math

import itertools

#import bisect

import copy
from functools import lru_cache

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

#    h,w,a,b = map(int, input().split())
#    c = [[0 for j in range(n)] for i in range(n)]



def main():
    s=input()
    s=list(s)
    temp=0
    ans="Yes"
    for i in range(len(s)):
        if s[i]=="h" and temp==0:
            temp=1
        elif s[i]=="i" and temp==1:
            temp=0
        else:
            ans="No"
            break
    if len(s)%2!=0:
        ans="No"
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
s = input()


length = len(s)//2
if len(s) % 2 != 0:
    print("No")
    exit(0)

tmp = 0
for i in range(0, len(s), 2):
    if s[i] == 'h' and s[i+1] == 'i':
        tmp += 1

if length == tmp:
    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]:
    if s[i]+s[i+1] != 'hi':
        print('No')
        exit()
else:
    print('Yes')

Submission status: Accepted

Solution code:
import sys
import numpy as np

# input = sys.stdin.readline

s = input()

if len(s) % 2 != 0:
    print("No")
else:
    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()
if len(s) % 2:
    print("No")
else:
    if s == "hi" * (len(s) // 2):
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()

ans=False

if len(S)%2==0:
    if S=='hi':
        ans=True
    elif S=='hihi':
        ans=True
    elif S=='hihihi':
        ans=True
    elif S=='hihihihi':
        ans=True
    elif S=='hihihihihi':
        ans=True
    else:
        pass
else:
    pass

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

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import collections

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

S = str(input())

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

if ans:
    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()
List = list(S)
ans = 1
h = 0
ii = 0

for i in range(len(List)):
  a = List[i]
  if a == "h":
    h = 1
    ii = 0
  elif h == 1 and a == "i":
    h = 0
    ii = 1
  else:
    ans = 0

if ans == 1 and ii == 1:
  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 not s[i:i+2]=="hi":
        print("No")
        exit()
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

ok_list = ["hi" * n for n in range(1, 6)]

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

Submission status: Accepted

Solution code:
S = input()

def main(S):

    for i, s in enumerate(S):

        if i % 2 == 0:
            if s == 'h': continue
            else       : return "No"
        
        else:
            if s == 'i': continue
            else       : return "No"

    else: 
        if len(S) % 2 == 0:
            return "Yes"
        else:
            return "No"
    

if __name__ == "__main__":

    answer = main(S)
    print(answer)

Submission status: Accepted

Solution code:
s=input()

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s = input()

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

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

print('Yes')

Submission status: Accepted

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

s = readline().rstrip().decode('utf-8')
n = len(s)

if n%2 != 0:
    print("No")
    exit()
else:
    for i in range(0,n,2):
        if s[i:i+2] != "hi":
            print("No")
            exit()
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

if len(s)%2 != 0:
    print('No')
    exit()
else:
    for x in range(0,len(s), 2):
        if s[x:x+2] != 'hi':
            print('No')
            exit()
print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
for i in range(1,6):
  hikaku = 'hi' * i
  if S == hikaku:
    print('Yes')
    exit()
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()
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 flag and len(S)%2==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#gcdは3.4.3だとfractionsにある
from fractions import gcd
import math

from math import factorial as f

from math import ceil,floor,sqrt


import bisect
import re
import heapq


from copy import deepcopy
import itertools

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

yes = "Yes"
no = "No"

def main():
    s = input()
    if len(s) %2:
        print(no)
        exit()

    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()
    
    print(yes)
            




main()

Submission status: Accepted

Solution code:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7


S = input()
if len(S) % 2 != 0:
    print('No')
    exit(0)
for i, c in enumerate(S):
    if i % 2 == 0 and c != 'h':
        print('No')
        exit(0)
    if i % 2 != 0 and c != 'i':
        print('No')
        exit(0)
print('Yes')

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s=input()
l=len(s)
bo =True
if l%2==1:
	print("No")
else:
	x=int(l/2)
	for i in range(x):
		if s[2*i]!="h" or s[2*i+1]!="i":
			bo=False
			break
	if bo==True:
		print("Yes")
	else:
		print("No")

Submission status: Accepted

Solution code:
s = input()
if len(s)%2:
    print('No')
    exit()
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:
n = list(input())
if len(n) % 2 != 0:
         print("No")
         exit()
for i in range(len(n)):
         if i % 2 == 0:
                  if n[i] != "h":
                           print("No")
                           exit()
         elif i % 2 == 1:
                  if n[i] != "i":
                           print("No")
                           exit()
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:

a = input()

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

Submission status: Accepted

Solution code:
def solve():
    S = input()
    if len(S) % 2 == 1 or len(S) == 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')


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
s = input()

s_num = len(s)
flag = 0 if s_num%2==0 else 1
for i in range(s_num//2):
    if s[2*i:2*i+2] != 'hi':
        flag = 1

ans = 'No' if flag==1 else 'Yes'
print(ans)

Submission status: Accepted

Solution code:
S=list(input())
odd = 1
for i in range(len(S)):
    if odd == 1:
        if S[i] != 'h':
            print ("No")
            exit(0)
    if odd == 0:
        if S[i] != 'i':
            print ("No")
            exit(0)

    odd = 1 - odd

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

Submission status: Accepted

Solution code:
S=input()

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

Submission status: Accepted

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

s = input()
n = len(s)
flg = False
for i in range(n):
    if not flg:
        if s[i] == 'h':
            flg = True
            continue
    else:
        if s[i] == 'i':
            flg = False
            continue
    print('No')
    quit()
if s[-1] != 'i':
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
S = input()

if len(S) % 2 != 0:
    print("No")
else:
    N = int(len(S) / 2)

    flag = 0

    for indx in range(N):
        if ((S[indx * 2 + 0] != "h") or
            (S[indx * 2 + 1] != "i")):
            flag = 1

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

Submission status: Accepted

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

Submission status: Accepted

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

S = input()
L = len(S)
if not L%2==0:
    print('No')
    exit()
i = 0
while i<L:
    if not S[i:i+2]=='hi':
        print('No')
        exit()
    i+=2
print('Yes')

Submission status: Accepted

Solution code:
#A - Hitachi String
S = list(input())
count = 0
if len(S) % 2 == 1:
    print("No")
    exit()
else:

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

    print("Yes")

Submission status: Accepted

Solution code:
S = input()
len_s = len(S)
hitachi = 'hihihihihi'
if len_s%2==1:
    print('No')
else:
    if S==hitachi[0:len_s]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
S = input()

S_sp = S.split("hi")
# print(set(S_sp))
if set(S_sp) == {""}:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

if len(s) == 0:
  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 = YES

    for i, s in enumerate(S):
        if i%2==0:
            if s != "h":
                ans = NO
                break
        else:
            if s != "i":
                ans = NO
                break
    if len(S) % 2 == 1:
        ans = NO
    print(ans)


# 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 = list(input())

i = 0
if len(s) % 2 != 0:
    print("No")
    exit()
while i < len(s):
    if s[i] != "h" or s[i + 1] != "i":
        print("No")
        exit()
    i += 2

print("Yes")

Submission status: Accepted

Solution code:
import sys
import bisect
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

s = S()
N = len(s)
if N%2 == 0:
  if s.count("hi") == N//2:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Accepted

Solution code:
n = str(input())
ans = 'Yes'
if len(n)%2 == 1:
    ans = 'No'
else:
    for i in range(0, len(n)-1, 2):
        if n[i] != 'h' or n[i + 1] != 'i':
            ans = 'No'

print(ans)

Submission status: Accepted

Solution code:
s = input()

if len(s) % 2 == 0:
    ans = True
else:
    ans = False

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
S = input()
c = S.count('hi')
s = S.split('hi')

for ss in s:
    if ss=='':continue
    elif ss!='hi':
        print('No')
        exit()

if len(s)-1==c : 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' 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())

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 = 'No'

if s.count('hi') * 2 == len(s):
    ans = 'Yes'

print(ans)

Submission status: Accepted

Solution code:
N = input()
chk = 0
if len(N)%2 == 1:
  print("No")
else:
  for i in range(len(N)//2):
    if N[(2*i):(2*i+2)] != "hi":
      chk = 1
      break
    else:
      continue
  if chk == 1:
    print("No")
  else:
    print("Yes")

Submission status: Accepted

Solution code:
s = input()
l = len(s)
c = s.count('hi')
if 2 * c == l:
    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()

f = len(s) % 2 == 0
for c in s[0::2]:
    if c != 'h':
        f = False

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

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

Submission status: Accepted

Solution code:
from collections import defaultdict
from collections import deque
from string import ascii_uppercase
import sys, bisect, math, heapq

stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

S = read_str()

def solve():
    if len(S) < 2 or len(S) % 2 == 1:
        return 'No'
    for i, s in enumerate(S):
        if i % 2 == 0:
            if s != 'h': return 'No'
        else:
            if s != 'i': return 'No'
    return 'Yes'

if __name__ == "__main__":
    print(solve())

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:i+2] != 'hi':
            print('No')
            break
    else:
        print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

correct = True
if len(s) % 2 != 0:
    print("No")
    correct = False
else:
    length = len(s) // 2
    for i in range(length):
        if s[i * 2] != "h":
            print("No")
            correct = False
            break
        elif s[i*2 +1] != "i":
            print("No")
            correct = False
            break

if correct:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def main():
    s = input()
    sl = list(s)
    sl_o = [c == 'h' for c in s[::2]]
    sl_e = [c == 'i' for c in s[1::2]]
    if all(sl_o) and all(sl_e) and s[-1] == ('i'):
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

if s == "":
  ans = "Yes"
else:
  ans = "No"

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return input().split()
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10

#solve
def solve():
    s = S()
    i = 0
    while i != len(s):
        if s[i] == "h" and s[i + 1] == "i":
            i += 2
        else:
            print("No")
            return

        if len(s) == i + 1:
            print("No")
            return
        
    print("Yes")
    return


#main
if __name__ == '__main__':
    solve()

Submission status: Accepted

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

S=input().strip()

while S:
    if S[-2:]=="hi":
        S=S[:-2]
    else:
        break

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

Submission status: Accepted

Solution code:
def main():
    s = input()
    
    if len([x for x in s.split('hi') if x != '']) == 0:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = input()
if len(n)%2==1:
  print('No')
  exit()
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()
print('Yes')

Submission status: Accepted

Solution code:
def main(s):
    if len(s)%2 != 0 :
        return False
    for i in range(len(s)):
        res = True
        if i%2 == 1:
            continue
        else:
            if s[i]!="h" or s[i+1]!="i":
                return False
    return res

s = input()
print("Yes" if main(s) else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:

a = input()

ans = "No"
if len(a) % 2 == 0:
    for i in range(int(len(a)/2)):
        if a[i*2] != "h" or a[i*2+1] != "i":
            break
    else:
        ans = "Yes"
print(ans)

Submission status: Accepted

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

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]+s[i+1]=="hi":
        continue
    else:
        print("No")
        exit()
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
h = "hi"

for i in range(5):
    if (len(S) == 1 or S.find(h) != 0):
        print("No")
        exit()
    S = S[2:]
    if (len(S) == 0):
        break

print("Yes")

Submission status: Accepted

Solution code:
s = list(input())
a = 0
for i in range(len(s)):
  if i%2 == 0:
    if s[i] == "h":
      continue
    else:
      a += 1
  elif i%2 == 1:
    if s[i] == "i":
      continue
    else:
      a += 1
if s[-1] == "h":
  a += 1
if a == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S = input()
if len(S) % 2 == 0:
    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")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=str(input())
for i in range (6):
    if s =="hi"*i:
        print("Yes")
        exit()
for i in range (6):
    if s !="hi"*i:
        print("No")
        break

Submission status: Accepted

Solution code:
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate
import sys
import bisect
import string
import math
import time


def I(): return int(input())


def S(): return input()


def MI(): return map(int, input().split())


def MS(): return map(str, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


def print_matrix(mat):
    for i in range(len(mat)):
        print(*mat)


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


YNL = {False: 'No', True: 'Yes'}
YNU = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**10
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']

show_flg = False
# show_flg = True


def main():
    s = S()
    count = 0

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

    for i in range(0, len(s), 2):
        if s[i] == 'h' and s[i+1] == 'i':
            # print(s[i], s[i+1])
            count += 1

    if count == len(s) // 2:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()