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 len(s) % 2 == 1:
    print('No')
    exit()

for n in range(0, len(s) // 2 + 1, 2):
    if not s[n:n + 2] == 'hi' :
        print('No')
        exit()
print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()

n = a.count('hi')
b = a.count('hii')

if(len(a)/2==n):
	print("Yes\n")
else:
	print("No\n")

Submission status: Accepted

Solution code:
input = input()

if len(input) % 2:
    print("No")
    exit(0)

result = "Yes"
isHi = False
for i in range(len(input)-1):
    if isHi:
        isHi = False
        continue;

    str = input[i] + input[i+1]
    if str != "hi":
        result = "No"
        break

    isHi = True

print(result)

Submission status: Accepted

Solution code:
import sys

S = input()

flag = 0

for s in S:
    if s == "h":
        flag = flag + 1
        if flag >= 2:
            print("No")
            sys.exit()
    elif s == 'i':
        flag = flag - 1
        if flag < 0:
            print("No")
            sys.exit()
    else:
        print("No")
        sys.exit()

if s == "h":
    print("No")
    sys.exit()    

print("Yes")

Submission status: Accepted

Solution code:
S=list(input())
tmp=""
ans="No"
for s in S:
    if(tmp==""):
        tmp=s
        ans="No"
    else:
        if(s=='i' and tmp=='h'):
            ans="Yes"
            tmp=''
        else:
            ans="No"
            break
print(ans)

Submission status: Accepted

Solution code:
S = input()
pattern = 'hi'
cnt = len(S)//2
for _ in range(cnt-1):
    pattern += 'hi'

if S == pattern:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
str = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re;print(re.match('(hi)+$',input())and'Yes'or'No')

Submission status: Accepted

Solution code:
s = input()
ans = "Yes"
if len(s) % 2 != 0:
  ans = "No"
else:
  for i in range(len(s)//2):
    if s[i*2] != "h" or s[i*2+1] != "i":
      ans = "No"
      break
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')
"""
if len(S) == 1:
  print('No')
elif len(S) == 2:
  if S == 'hi':
    print('Yes')
  else:
    print('No')
else:
  flag = 0
  i = 0
  while i < len(S)-1:
    if S[i:i+2] == 'hi':
      flag = 1
    else:
      flag = 0
      break
    i += 2
  if flag == 1:
    print('Yes')
  else:
    print('No')
"""

Submission status: Accepted

Solution code:
a = input()
l = list(a)
num = len(l)
TorF = True

if num % 2 == 0:
    b = int(num/2)
    for i in range(b):
        if not (a[2*i] == 'h' and a[2*i + 1] == 'i'):
            TorF = False
            break
else:
    TorF = False

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

Submission status: Accepted

Solution code:
import re

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

Submission status: Accepted

Solution code:

input_line = input()
Line = list(input_line)

flag = 0

for i in Line:
    # print(i)

    if i == "h" and flag == 0:
        flag = 1
    elif i == "i" and flag ==1:
        flag = 0
    else:
        flag = 2

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = str(input())
if len(s) % 2 == 1:
    print("No")
    exit()
j = 0
while j < len(s) - 1:
        # 前から5文字ずつ見ていく
        if s[j:j + 2] == "hi":
            # 一致すれば5文字分進める
            j += 2
        else:
            print("No")
            exit()

print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

s = s.replace('hi', '')
#print(s)
if s == '':
  print('Yes')
  exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
lens = len(S)

if S == '':
    print('No')
    exit()

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

print('Yes')

Submission status: Accepted

Solution code:
s=input()
list=[]
for i in range(1,100):
    list.append("hi"*i)
if s in list:
    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=input()
ans="No"
flg=0
flg1=0

if len(S) == 1:
  ans="No"
elif len(S) < 11:
  flg1=1
  for i in range(len(S)):
    if flg==0:
      if S[i] == 'h':
        flg=1
      else:
        flg=2
        break
    elif flg==1:
      if S[i] == 'i':
        flg=0
      else:
        flg=2
        break
else:
  ans="No"
        
if flg==0 and flg1 == 1:
  ans="Yes"
          
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 = input()
s_len = len(s)
if s_len % 2:
  print("No")
else:
  prev = 0
  count = 0
  for i in range(1, (s_len//2)+1):
    if s[prev*2:i*2] != "hi":
      print("No")
      break
    else:
      count += 1
      prev = i
  if count == s_len // 2:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
str = input().split('i')
flag = True

for s in str[0:-1]:
  if(flag):
    if(s != 'h'):
      print('No')
      flag = False

if(flag):
  if(str[len(str)-1] != ''):
    print('No')
    flag = False
if(flag):
  print('Yes')

Submission status: Accepted

Solution code:
s = input()
i = int(len(s) / 2)
if "hi" * i == s:
    print("Yes")

else:
    print("No")

Submission status: Accepted

Solution code:
import re

s = input()
if len(s) % 2 == 1:
  s += "a"
li = re.split('(..)',s)[1::2]
check = "hi"
ans = 0
for i in li:
  if check not in i:
    ans += 1
if ans == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush,heapify
from fractions import gcd
from copy import deepcopy
import math
import queue
#import numpy as np
#import sympy as syp(素因数分解とか)
Mod = 1000000007
import sys
sys.setrecursionlimit(100000) 
  
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)

def main(): #startline--------------------------------------------
    s = input()
    s = s.replace("hi","")
    print("No" if s else "Yes")
#endline===============================================
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
S=input().split("hi")
flag=False


for i in S:
    if i =="":
        continue
    else:
        flag=True
        
if flag:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
s = input()
n = len(s) // 2
lst = [(i + j) for (i, j) in zip(s[::2], s[1::2])]

check = 0
for i in range(n):
    if lst[i] == 'hi':
        check = 1
    else:
        check = 0
        break

if len(s) % 2 == 1:
    check = 0

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

Submission status: Accepted

Solution code:
S=input()

hi="hi"

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
a = list(input())
#print(a)
Flag=True
if a.count('h')+a.count('i')!=len(a):
    Flag = False
if a[0::2].count('h')!=len(a)/2:
    Flag = False
if a[1::2].count('i')!=len(a)/2:
    Flag = False

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

Submission status: Accepted

Solution code:
import re

s = str(input())
m = re.fullmatch(pattern='(hi)+', string=s)
if m:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s = str(input())
x = int(len(s) / 2)
if len(s) % 2 == 0:
    if 'hi' * x == s:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

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

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

Submission status: Accepted

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

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


for i in range(l):
    if i%2 == 0 and S[i]!="h":
        print("No")
        exit()
    if i%2 != 0 and S[i]!="i":
        print("No")
        exit()
print("Yes")

Submission status: Accepted

Solution code:
test_input = str(input())
v = [(test_input[i*2]+test_input[i*2+1]) for i in range(int(len(test_input)/2))]
if len(test_input)%2 !=0:
    print("No")
elif set(v) == set(["hi"]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:

s = input()

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

print("Yes")

Submission status: Accepted

Solution code:
import math
s = input()
n = math.ceil(len(s)/2)
hitachi = ""
for i in range(n):
  hitachi += "hi"
if hitachi in s:
  print("Yes")
else:
  print("No")

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

Submission status: Accepted

Solution code:
S = input()
A = 'No'
if len(S) == 2:
    if S == 'hi':
        A = 'OK'
if len(S) == 4:
    if S == 'hihi':
        A = 'OK'
if len(S) == 6:
    if S == 'hihihi':
        A = 'OK'
if len(S) == 8:
    if S == 'hihihihi':
        A = 'OK'
if len(S) == 10:
    if S == 'hihihihihi':
        A = 'OK'

if A == 'OK':
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# inputs = list(map(int, (input().split())))

a = input()

hi = "hi"

for i in range(5):
    if a == hi:
        print("Yes")
        exit(0)
    hi = hi + "hi"
print("No")

Submission status: Accepted

Solution code:
a=input()

if a=='hi':
  print('Yes')
  exit()
elif a=='hihi':
  print('Yes')
  exit()
elif a=='hihihi':
  print('Yes')
  exit()
elif a=='hihihihi':
  print('Yes')
  exit()
elif a=='hihihihihi':
  print('Yes')
  exit()
  
print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
a = S.count("hi")
b = len(S)

if a == b/2 :
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# import sys
# sys.stdin=open('input.txt','r')

def main():
    s = input()
    n = len(s)
    if n%2!=0:
        print('No')
        return
    else:
        q=s[:2]
        if q!='hi':
            print('No')
            return
        a=2
        while a<=n-2:
            if s[a:a+2]!=q:
                print('No')
                return
            a+=2
        print('Yes')
        return
main()

Submission status: Accepted

Solution code:
s=input()
while True:
  if len(s)==0:
    print("Yes")
    break
  elif len(s)==1:
    print("No")
    break
  elif s[:2]=="hi":
    s=s[2:]
  else:
    print("No")
    break

Submission status: Accepted

Solution code:
S = input()
L = len(S)
cnt = S.count("hi")

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

elif (L // 2 == cnt):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
s = list(S)
k = []
a = round(len(s) / 2)
b = len(s) % 2
if b == 0:
    for i in range(a):
        k.append(s[i * 2]+s[i * 2 + 1])
    n = 0
    for j in range(a):
        if k[j] == "hi":
            n = n + 1
    if n == 0:
        print("No")
    elif n == a:
        print("Yes")
    else:
        print("No")
    
else:
    print("No")

Submission status: Accepted

Solution code:
import math
import sys
#読み込み
s = input()
num = len(s)

#偶数個の文字でなければno
if num % 2 != 0:
    print("No")
    sys.exit()

#偶数番目がhか判定
for i in range(math.floor(num/2)):
    if s[2 * i] != "h":
        print("No")
        sys.exit()

#奇数番目がiか判定
for j in range(math.floor(num/2)):
    if s[2 * j + 1]  != "i":
        print("No")
        sys.exit()
        
print("Yes")

Submission status: Accepted

Solution code:
s = input()
data = len(s)
s = list(s)
j = 0
for i in s:
  if j%2 == 0:
    if i != "h":
      break
  if j%2 == 1:
    if i != "i":
      break
  j += 1

      
if j == data and data%2 == 0:
  print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
l = ["hi", "ta", "chi"]
ans = "Yes"

n = []
for i in range(len(S)):
  if i not in n:
    if S[i: i + 2] in l:
      n.append(i + 1)
      continue
    elif S[i: i + 3] in l:
      n.append(i + 2)
    else:
      ans = "No"
      break
print(ans)

Submission status: Accepted

Solution code:
s = input()
h_else_i = True
 
ret = True
for char in s:
  if h_else_i:
    if char == "h":
      h_else_i = not h_else_i
      continue
    else:
      ret = False
      break
  else:
    if char == "i":
      h_else_i = not h_else_i
      continue
    else:
      ret = False
      break
if ret and h_else_i:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n = input()
flag = True
if len(n) % 2 == 1:
    flag = False
for i in range(len(n)-1):
    if n[i] == 'h' and n[i+1] == 'i':
        continue
    elif n[i] == 'i' and n[i+1] == 'h':
        continue
    else:
        flag = False
        break
if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()
a = True
for i in range(len(S)):
    if len(S) % 2 != 0:
        a = False 
        break
    else:
        if i %2==0 and (S[i] != 'h' or S[i+1] != 'i'):
            a = False

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

Submission status: Accepted

Solution code:
S=input()

i=0
flag=0
while i<len(S) and len(S)%2==0:
    if S[i] == 'h' and S[i+1] == 'i':
        i=i+2
    else:
        flag=1
        i=len(S)

if flag==0 and len(S)%2==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()
hi_count = S.count('hi')

if len(S) == hi_count * 2 :
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s = input()
if s in ["hi" * i for i in range(1, 6)]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
import re
if re.fullmatch(r'(hi)+',S):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()
if len(S) != (S.count('h') + S.count('h')):
    print('No')
else:
    if S.count('h') == S.count('i') and S.count('i') == S.count('hi'):
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
input_line = input()

remaining = input_line.replace("hi", "")

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

Submission status: Accepted

Solution code:
s=list(input())
if len(set(s))==2 and all([i=="h" for i in s[0::2]]) and all([i=="i" for i in s[1::2]]) and len(s)%2==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = str(input())

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

if len(ss) == 0:
    ans = 'Yes'
else:
    ans = 'No'

print(ans)

Submission status: Accepted

Solution code:
x = input()
y = "hi"
for i in range(5):
    if y == x:
        print("Yes")
        break
    y = y + "hi"
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
d=["hi","hihi","hihihi","hihihihi","hihihihihi"]
if s in d:
  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*2] != 'h' or S[i*2+1] != 'i':
    print ('No')
    sys.exit()
print('Yes')

Submission status: Accepted

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

import sys
import math
import itertools

def main():
    s = sys.stdin.readline().strip()

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import re

S = input()

items = re.split('(..)',S)[1::2]

flg = False

for item in items:
    if item != "hi":
        flg = True

if len(S) % 2 == 1 or flg:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

S = str(input())

output = 'No'

if ('hi' in S):

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

    if S.isupper():
        output = 'Yes'


print(output)

Submission status: Accepted

Solution code:
from sys import stdin

def main():

    input = stdin.readline

    S = input()[:-1]

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

    for i in range(len(S)//2):

        if (S[i*2:i*2+2] == "hi"):
            continue
        else:
            print("No")
            return
    
    print("Yes")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

S=input().strip()

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

for i,word in enumerate(S):
  if (i%2==0 and word=="h") or (i%2==1 and word=="i"):
    continue
  else:
    print("No")
    break

else:
  print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re
S = input()

pattern = r'^(hi)+$'
results = re.match(pattern, S)

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

Submission status: Accepted

Solution code:
S = input()
ans = 'None'
l = len(S)
if not l % 2 == 0:
    ans = 'No'
else:
    for j in range(l//2):
        if not (S[2*j] == 'h' and S[2*j+1] == 'i'):
            ans = 'No'
            break
        if j == (l//2)-1:
            ans = 'Yes'
print(ans)

Submission status: Accepted

Solution code:
s = str(input())
x = "hi"
i = 1
count = 0

for i in range(1, 6):
    if(s == x * i):
        count += 1

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

Submission status: Accepted

Solution code:
s = input().split("hi")

if len(s)==1:
  print("No")
elif len(set(s)) == 1:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
s=input()
a=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')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# import re
s = input()
# m = re.fullmatch(hi{1,10},s):
# if m = "None":
#     print("No")
# else:
#     print("Yes")

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 = "Yes"
cnt = 0
if len(S)%2 == 1:
  ans = "No"
for i in S:
  if cnt%2==0:
    if i != "h":
      ans = "No"
  else:
    if i != "i":
      ans = "No"
  cnt += 1
print(ans)

Submission status: Accepted

Solution code:
s = input()
flg = 0
if len(s) % 2 == 0:
    for i in range(0, len(s), 2):
       if s[i] != 'h':
           flg = 1
           break
    else:
        for i in range(1, len(s), 2):
            if s[i] != 'i':
                flg = 1
                break
else:
    flg = 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
stringToCheck=input()
j=0;
i=0;
notHitachi=False
length=len(stringToCheck)
if length%2 !=0:
 notHitachi=True
else:
 while i < len(stringToCheck):
  i+=2
  if not stringToCheck[j:i]=='hi': notHitachi=True
  j=i
if notHitachi: print("No")
else: print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
ans = "Yes"
if S.__len__() % 2 != 0:
    ans = "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:
            ans = "No"
print(ans)

Submission status: Accepted

Solution code:
S = list(input())
len = len(S)
flag = 1
s = S[0]


for i in range(0, len, 2):
    if len%2 == 1:
        flag = 0
        break

    if S[i] != 'h' or S[i+1] != 'i':
            flag = 0

    """""
    if s == 'h':
        if S[i] == 'i':
            flag = 1
    if s == 'i':
        if S[i] == 'h':
            flag = 1
    s = S[i]
    """

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

Submission status: Accepted

Solution code:
s= input()

flg = 1
if len(s)%2 == 0:
    for i in range(len(s)//2):
        if s[0+i*2:2+i*2] != "hi":
            break
        if i == len(s)//2 -1:
            print("Yes")
            flg = 0
    if flg == 1:
        print("No")
else:
    print("No")

Submission status: Accepted

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

if len(list(s_r)) == 0:
    print("Yes")

else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

S = input().strip()
l = ['hi', 'hihi', 'hihihi', 'hihihihi', 'hihihihihi']

print('Yes') if S in l else print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(input())
ans_h = 0
ans_i = 0
count_h = 0
count_i = 0

for i in range(0,len(S),2):
    if S[i] != 'h':
        ans_h += 1
    else:
        count_h += 1

for j in range(1,len(S),2):
    if S[j] != 'i':
        ans_i += 1
    else:
        count_i += 1

if ans_h == 0 and ans_i == 0 and count_h == count_i:
    print('Yes')
else:print('No')

Submission status: Accepted

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

Submission status: Accepted

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

s = input()

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
if "".join(s.split("hi")) == "":
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=str(input())

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

Submission status: Accepted

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