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:
f=0
s=list(input())
if len(s)%2==1:
    f=1
else:
    for i in range(len(s)):
        if i%2==1:
            if s[i]!='i':
                f=1
                break
        else:
            if s[i]!='h':
                f=1
                break
if f==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
a=input()
list_1=list(a)
length=len(list_1)
count=0
if length%2==1:
  print("No")
else:
  for k in range(0,length,2):
    if list_1[k]=='h' and list_1[k+1]=='i':
      count+=2
      if count==length:
        print("Yes")
        break
    else:
      continue
  else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

    if len(S) % 2 == 1:
        print('{}'.format('No'))
        exit()

    for i in range(1, len(S), 2):
        if S[i - 1: i + 1] != 'hi':
            print('{}'.format('No'))
            exit()
    
    print('{}'.format('Yes'))

if __name__ == '__main__':
    main()

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

Submission status: Accepted

Solution code:
# coding:utf8
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.count("hi") == len(s)/2:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import fractions

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

    # divisors.sort()
    return divisors

def ValueToBits(x,digit):
    res = [0 for i in range(digit)]
    now = x
    for i in range(digit):
        res[i]=now%2
        now = now >> 1
    return res

def BitsToValue(arr):
    n = len(arr)
    ans = 0
    for i in range(n):
        ans+= arr[i] * 2**i
    return ans

def ValueToArray10(x, digit):
    ans = [0 for i in range(digit)]
    now = x
    for i in range(digit):
        ans[digit-i-1] = now%10
        now = now //10
    return ans

def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p
'''
p = 10 ** 9 + 7
N = 10 ** 6 + 2
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用

for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)
'''


#a = list(map(int, input().split()))

s = input()
ans = "No"
if(s == "hi"):
    ans ="Yes"
if(s == "hihi"):
    ans ="Yes"
if(s == "hihihi"):
    ans ="Yes"
if(s == "hihihihi"):
    ans ="Yes"
if(s == "hihihihihi"):
    ans ="Yes"
print(ans)

Submission status: Accepted

Solution code:
text = input()
answer = "No"
#print(text)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re

S = input() 

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

else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
 
 
def main():
 
    in_data = input().split('hi')
 
    if ('' in set(in_data) and 
       len(set(in_data)) == 1 ) :
        print('Yes')
    else:
        print('No')
 
    return 0
  
  
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import re
given = input()
answer = re.sub(r'hi', "*", given)
if len(set(answer)) == 1 and answer[0] == "*":
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re

pattern = '(hi)+'
compiled = re.compile(pattern)
input_value = input()
result = compiled.match(input_value)
if result == None:
  print('No')
elif result.group() == input_value:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
hitachi = input()
#type(hitachi)
flag = 0
if(len(hitachi) == 1):
    hitachi += " "
elif(len(hitachi) >= 11):
    hitachi = " "
elif(len(hitachi) % 2 ==1):
    hitachi += " "
for x in range(len(hitachi)):
    if(hitachi[x] == " "):
        break
    if(x %2 == 0):
        if(hitachi[x] + hitachi[x+1] == "hi"):
            #print(hitachi[x] + hitachi[x+1])
            flag += 1
        else:
            #print(hitachi[x] + hitachi[x+1])
            print("No")
            break
if(not len(hitachi) == 0):
    if(flag == len(hitachi)//2):
        print("Yes")

Submission status: Accepted

Solution code:
def ishitach(str):

    length_str = len(str)

    if length_str < len('hi'):
        return 'No'
    else:
        start_index = 0
        end_index = len('hi')
        while end_index <= length_str:
            if str[start_index:end_index] == 'hi':
                pass
            else:
                return 'No'

            start_index = start_index + 2
            end_index = end_index + 2
            if length_str < end_index and str[start_index:] != '':
                return 'No'

    return 'Yes'


if __name__ == '__main__':
    print(ishitach(str(input())))

Submission status: Accepted

Solution code:
s = str(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:
import re
index = re.fullmatch(r'(hi)+', input())
if index:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
hi = [s[i:i+2] for i in range(0, len(s), 2)]

a = 0
for i in range(len(hi)):
  if hi[i] != 'hi':
    a += 1
    break
    
if a == 1:
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
h = input()

result = 'Yes'

if len(h)%2 != 0:
  result ='No'
  
for a in range(0,len(h)-1,2):  
  b = h[a:a+2]
  if b != 'hi':
    result = 'No'
    break
    
print(result)

Submission status: Accepted

Solution code:
import math

text = input()

if text == "hi" or text == "hihi" or text == "hihihi" or text == "hihihihi" or text == "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 = input()
if s == "hi" * (len(s) // 2):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
isEmpty = False
if 'hi' not in s:
    print("No")
    isEmpty = True
s = s.split('hi')
s = set(s)
if not isEmpty:
    if '' in s and len(s) == 1:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = str(input())
if s.startswith('hi'):
    if s.endswith('hi'):
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:

S = input()
st = []
if len(S) %2 != 0 :
    print('No')
else :
    for i in range(len(S) // 2) :
        st.append(S[i*2:i*2+2])
      
    st = list(set(st)) 
    if len(st) == 1 and st[0] == 'hi' :
        print('Yes')
    else :
        print('No')

Submission status: Accepted

Solution code:
S = input()
#print(S)
ss = S.split('hi')
#print(ss)
len_sum = sum([len(x) for x in ss])
#print(len_sum)
if len_sum == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = raw_input()

length = len(n)
if length % 2 == 0:
  if n.count('hi')==length/2:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Accepted

Solution code:
S = input()
i = 0
count = 0
length = len(S)

if S[length - 1] == "h":
  count = 1
elif length % 2 == 1:
  count = 1
else:
  while i <= len(S)-2:
    if S[i] == "h" and S[i + 1] == "i":
      i += 2
    else:
      count = 1
      break

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

Submission status: Accepted

Solution code:
#1 question on hitachi contest
class Solution:
    def answer(self, str_in):
        n = len(str_in)
        if n == 1:
            return "No"
        if n%2 != 0:
            return "No"
        i = 1
        arr = []

        for i in range(0,len(str_in)):
            
            if str_in[i] == 'h' and str_in[i+1]== 'i':
                arr.append(i)
                
            elif str_in[i] == 'i' and str_in[i-1] == 'h':
                
                if arr == []:
                    return "No"
                else:
                    arr.pop()
            else:
                return "No"
        if arr == []:
            return "Yes"
        else:
            return "No"

str_in = input()

s = Solution()
print(s.answer(str_in))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
S = str(input())
ans = 0
if len(S) == 1:
    print('No')
    ans = 1
    sys.exit()
if S[-1] == 'h' and ans != 1:
    print('No')
    ans = 1
    sys.exit()
if S[-1] == 'i' and S[-2] != 'h':
    print('No')
    sys.exit()
for i in range(len(S)-1):
    if S[i] != 'h' and S[i] != 'i' and ans != 1:
        print('No')
        ans = 1
        break
    if S[i] == 'i' and S[1-1] != 'h' and ans != 1:
        print('No')
        ans = 1
        break
    if S[i] == 'h' and S[i+1] != 'i' and ans != 1:
        print('No')
        ans = 1
        break
if ans == 0:
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if n % 2 == 1:
    print('No')
else:
    if n == 2:
        if s == 'hi':
            print('Yes')
        else:
            print('No')
    elif n == 4:
        if s == 'hihi':
            print('Yes')
        else:
            print('No')
    elif n == 6:
        if s == 'hihihi':
            print('Yes')
        else:
            print('No')
    elif n == 8:
        if s == 'hihihihi':
            print('Yes')
        else:
            print('No')
    elif n == 10:
        if s == 'hihihihihi':
            print('Yes')
        else:
            print('No')

Submission status: Accepted

Solution code:
import sys
S= list(str(input()))
for i in range(len(S)-1):
    if S[i]=='h'and S[i+1]=='i'and S.count('h')==S.count('i'):
        print('Yes')
        sys.exit()
    elif S[i]=='h'and S[i+1]=='h':
        print('No')
        sys.exit()
print('No')

Submission status: Accepted

Solution code:
n=input()
ans = True
for i in range(0, len(n), 2):
    if n[i: i+2] != "hi":
        ans = False

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

Submission status: Accepted

Solution code:
s = input()
hitachi_str = ["hi","hihi","hihihi","hihihihi","hihihihihi"]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

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

Submission status: Accepted

Solution code:
letter = input()

for kk in range(len(letter)):
    if letter.startswith('hi'):
        letter = letter[2:]
        
if not letter:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8


def if_hi(input_):
    hi = 'hi'
    for i in range(0, len(input_), len(hi)):
        if input_[i:i+len(hi)] == hi:
            pass
        else:
            return False
    return True


def main():
    input_ = input()
    
    if len(input_) < 2:
        print('No')
    elif if_hi(input_):
        print('Yes')
    else:
        print('No')

    return 0


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a=input()

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

Submission status: Accepted

Solution code:
import re

s = input()
 
result = re.fullmatch("(hi){1,5}",s)
 
if result == None:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = input()
y = x.split('hi')
count = 0

for i in range(len(y)):
    if(y[i] != ''):
        count = count + 1

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

Submission status: Accepted

Solution code:
x = []
x = input()

y = 0

for i in range(len(x)):
    if x[0:2] != "hi":
        break
    if x[i] != 'h' and x[i] != 'i':
        y = 0
        break
    if len(x) % 2 != 0:
        break
    if x[i:i + 2] == "hi":
        y = 1
    else:
        pass

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = str(input())
s_cnt = len(s)

if s_cnt % 2 == 0:
    tmp = s_cnt / 2
    if s.count('hi') == tmp:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = str(input())

checker = True
if 'hi' not in s:
    checker =False

while 'hi' in s:
    s = s.replace('hi','XX')

for i in range(1,len(s)-1):
    if s[i] =='X':
        if s[i-1] == 'i' or s[i-1] == 'h'or s[i+1] == 'i' or s[i+1] == 'h':
            checker = False
            break

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

Submission status: Accepted

Solution code:
string = input()
flag = False
 
num = len(string)
if num % 2 == 0:
  for i in range(num // 2):
    if string[2*i:2*(i+1)] == "hi":
      if i == num // 2 - 1:
        flag = True
    else:
      break

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

Submission status: Accepted

Solution code:
S = input()
i = 0
result = 'Yes'
while i<len(S):
  if S[i:i+2] != 'hi':
    result = 'No'
    break
  i+=2
print(result)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# A 
s = input()

for i in range(0, len(s), 2):
    if len(s)%2 == 1:
        bool = False
        break
    elif s[i] == 'h' and s[i+1] == 'i':
        bool = True
    else:
        bool = False
        break
        
print('Yes' if bool else 'No')

Submission status: Accepted

Solution code:
s = input()

text = s
find = False
if 'hi' in text:
    text = text.replace('hi', '')
    find = True

ret = "No"
if len(text) == 0 and find == True:
    ret = "Yes"
print("{}".format(ret))

Submission status: Accepted

Solution code:
s=input()
i=0;
found=False;
h=0;
k=0;
if(len(s)%2!=0):
	found=False
else:
	while(i<len(s)):
		if(s[i]=='h' or s[i]=='i'):
			if(i%2==0 and s[i]=='h'):
				found=True
			if(i%2!=0 and s[i]=='i'):
				found=True
			if(i%2!=0 and s[i]=='h'):
				found=False
			if(i%2==0 and s[i]=='i'):
				found=False
			
		else:
			found=False
			break;		
		i=i+1
if(len(s)>1):
	if(s[0]=='i'):
		found=False
	if(s[1]=='h'):
		found=False

if(found==False):
	print("No")
else:
	print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
l = n.split("i")
#print(len(n))
#print(l)
i = int(len(l)-1)
#print(n)
#print(i)
#print(int(len(n)%2))
if int(len(n)%2)==0:
    if i==0:
        print("No")
    elif i==1:
        if l[0]=="h":
            print("Yes")
        else:
            print("No")
    elif i==2:
        if l[0]==l[1]=="h":
            print("Yes")
        else:
            print("No")
    elif i==3:
        if l[0]==l[1]==l[2]=="h":
             print("Yes")
        else:
            print("No")
    else:
        if l[0]==l[1]==l[2]==l[3]=="h":
            print("Yes")
        else:
            print("No")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
hitachi = input()

j = 0
tmp = 0

def check_hit(a,b):
    if a == b:
        return 1
    return 0


for i in hitachi:
    if j % 2 == 0:
        tmp += int(check_hit(i,"h"))
    else:
        tmp += int(check_hit(i,"i"))
    j+=1

if tmp == len(hitachi) and j%2==0 and tmp > 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

import re

input = input()

pattern = '^(hi)+$'

# compile後match
repatter = re.compile(pattern)
result = repatter.fullmatch(input)

if result is not None:
    print("Yes")
else:
    print("No")

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:
n = input()

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

print(ans)

Submission status: Accepted

Solution code:
import sys
S = list(input())
if len(S)%2 != 0:
    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()
s=s.replace('hi','')
if s:
	print('No')
else:
	print('Yes')

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()
n=len(s)
if n<=1:
  print("No")
  exit()
for i in range(n):
  if i!=n-1 and s[i]=="h":
    if s[i+1]!="i":
      print("No")
      exit()
  elif i!=0 and s[i]=="i":
    if s[i-1]!="h":
      print("No")
      exit()
  elif s[i]!="h" or s[i]!="i":
      print("No")
      exit()
print("Yes")

Submission status: Accepted

Solution code:
import sys
S = input()
if S == 'hi':
  print('Yes')
  sys.exit(0)
if S != 'hihi' and S != 'hihihi' and S != 'hihihihi' and S != 'hihihihihi':
  print('No')
  sys.exit(0)
print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

if len(S) == 2 and S == "hi":
    print("Yes")
    exit()
elif len(S) == 4 and S == "hihi":
    print("Yes")
    exit()
elif len(S) == 6 and S == "hihihi":
    print("Yes")
    exit()
elif len(S) == 8 and S == "hihihihi":
    print("Yes")
    exit()
elif len(S) == 10 and S == "hihihihihi":
    print("Yes")
    exit()

print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
i = s.count('h')
j = s.count('i')
h = 'hi'

if h in s:
  if ('ii' or 'hh') in s:
    print('No')
  else:
    if i == j:
        print('Yes')
    else:
        print('No')
else:
  print('No')

Submission status: Accepted

Solution code:
S = input()
N = int(len(S)/2)

[print('Yes') if S == 'hi'*N else print('No')]

Submission status: Accepted

Solution code:
str = input()

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

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

Submission status: Accepted

Solution code:
str = input()
str_len = len(str)
h_flag = 0
for cat_i in range(str_len):
  if str_len % 2 == 1:
    print('No')
    break
  
  if h_flag == 0 and str[cat_i] == 'h':
    h_flag = 1
  elif h_flag == 1 and str[cat_i] == 'i':
    h_flag = 0
  else:
    print('No')
    break
    
  if cat_i == (str_len - 1):
    print('Yes')

Submission status: Accepted

Solution code:
S = input()

flag = True

if len(S) % 2 == 0:
    if S.find('hi') % 2 == 0:
        flag = True
    else:
        flag = False
else:
    flag = False


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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s = input()
txt = 'No'

for i in range(5):
    if(s == 'hi' * (i + 1)):
        txt = 'Yes'
        break

print(txt)

Submission status: Accepted

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

def main():
    S = input()

    for i in range(1, 6):
        h = 'hi' * i
        if S == h:
            print('Yes')
            return
    else:
        print('No')

main()

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = input()
ans = False
if len(s) < 1 or len(s) >10:
    ans = False
if len(s) >= 1 or len(s) <= 10:
    if s == 'hi' or s == 'hihi' or s == 'hihihi' or s == 'hihihihi' or s == 'hihihihihi':
        ans =True
    else:
        ans =False
if ans:
    print ('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re
a = str(input())

m1 = re.match(r"^hi$", a)
m2 = re.match(r"^hihi$", a)
m3 = re.match(r"^hihihi$", a)
m4 = re.match(r"^hihihihi$", a)
m5 = re.match(r"^hihihihihi$", a)

if m1 or m2 or m3 or m4 or m5:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
hi = 'hi'
if len(S) % 2 == 0:
    T = len(S) // 2 * hi
    if S == T:
        print('Yes')
    else:
        print('No')
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()
l=len(s)
if l%2==0 and s.count("hi")==l/2:print("Yes")
else:print("No")

Submission status: Accepted

Solution code:
S=input()
if S[0]!="h":
    print("No")
    exit()
if len(S)<2:
    print("No")
    exit()
han="i"
for i in range(1,len(S)):
    if S[i]!=han:
        print("No")
        exit()
    if S[i-1]=="h":
        han="h"
    elif S[i-1]=="i":
        han="i"
if S[-1]=="h":
    print("No")
    exit()
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

import sys
import math
import collections
import itertools
from inspect import currentframe
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def MI() : return map(int, input().split())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def chkprint(*args) : names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}; print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

S = input()

N = len(S)

if N % 2 == 1:
    print("No")
else:
    flag = True
    for i in range(int(N/2)):
        a = i*2
        if not(S[a:a+2] == "hi"):
            flag = False
    if flag :
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
h = input()
l = len(h)
n = 0
hitachi = False

if l % 2 == 1:
  hitachi = False
  
else:
  m = int(l / 2)
  for i in range(m):
    if h[(2 * i)] == "h":
      n += 1
    if h[(2 * i)+1] == "i":
      n += 1
  
  if n == l:
    hitachi = True
  else:
    hitachi = False
    
if hitachi:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
str_i = input()

length= len(str_i)
flag = 1

if (length%2 != 0):
    
    flag = 0
    
else:
    str_list_d = ""
    for i in range(int(length/2)):
        k = i*2
        str_list_d =  str_i[k]+str_i[k+1] 
        if(str_list_d != "hi"):
            flag = 0
            break


if (flag == 1):
    print("Yes")

else:
    print("No")

Submission status: Accepted

Solution code:
import sys
S = input()
a = []
count = 0

for i in range(0, len(S)):
    a.append(S[i])

if len(S) % 2 == 0:
    for k in range(0, len(S)):
        if k % 2 == 0:
            if S[k] == "h":
                if S[k+1] == "i":
                    count += 1
                else:
                    print("No")
                    sys.exit()
            else:
                print("No")
                sys.exit()
        else:
            pass
else:
    print("No")

if count > 0:
    print("Yes")

Submission status: Accepted

Solution code:
#N=int(input())
#N,M=map(int, input().split())
#L=list(map(int, input().split()))
S = str(input())
if len(S)%2==1:
  print('No')
  exit()
n = 0
while len(S) > n:
    if n % 2 == 1 and S[n] != 'i':
        print('No')
        exit()
    elif n % 2 == 0 and S[n] != 'h':
        print('No')
        exit()
    n += 1

print('Yes')

Submission status: Accepted

Solution code:
S = input()
D = 0

if len(S)%2 != 0:
    print("No")
    D = 1
    
else:
    for i in range(len(S)//2):
        if ((S[i * 2] == "h") & (S[(i * 2) + 1] == "i")) != True:
            print("No")
            D = 1
            break
        
if D == 0:
    print("Yes")

Submission status: Accepted

Solution code:
print("NYoe s"[input()in["hi"*x for x in range(6)]::2])