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:
from __future__ import division, print_function

''' Hey stalker :) '''
INF = 10 ** 10
TEST_CASES = False


def main():
    st = input()
    if len(st)%2!=0:
        print('No')
        return
    for i in range(0,len(st),2):
        if st[i]!='h' or st[i+1]!='i':
            print('No')
            return
    print('Yes')


''' FastIO Footer by @c1729 and other contributors '''
import os
import sys
from bisect import bisect_left, bisect_right
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip
BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
# else:
#     sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")
get_int = lambda: int(input())
get_list = lambda: list(map(int, input().split()))
if __name__ == "__main__":
    if TEST_CASES:
        [main() for _ in range(int(input()))]
    else:
        main()

Submission status: Accepted

Solution code:
s = input()
if len(s)%2==0:
    t = 'hi' * (len(s)//2)
    if s == t:
        print('Yes')
        exit(0)
print('No')

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

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

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
n = len(s)
if n % 2 != 0:
  print('No')
  exit()
q = n // 2
ss = 'hi' * q
if s == ss:
  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()
for i in range(0,len(S),2):
    if S[i:i+2] != "hi":
        print("No")
        exit()
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
ans = "No"
if S == "hi":
    ans = "Yes"
elif S == "hihi":
    ans = "Yes"
elif S == "hihihi":
    ans = "Yes"
elif S == "hihihihi":
    ans = "Yes"
elif S == "hihihihihi":
    ans = "Yes"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#[int(i) for i in input().split()]
s = input()
c = 1
if len(s) % 2 != 0:
    print("No")
else:
    for i in range(len(s)//2):
        if s[2 * i:2 * i+2] == "hi":
            c *= 1
        else:
            c *= 0
    if c:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
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:
import sys

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

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""
s = input().split()[0]

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

Submission status: Accepted

Solution code:
import re

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

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
tmps = s
flag = 1
while len(tmps)>1:
    if tmps[0:2] == 'hi':
        tmps = tmps[2:]
    else:
        flag = 0
        tmps = tmps[2:]
if len(tmps)==1 or flag==0:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
S = input()
flag = True
for i, c in enumerate(S):
    if i % 2 == 0:
        if c != 'h':
            flag = False
            break
    else:
        if c != 'i':
            flag = False
            break

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

Submission status: Accepted

Solution code:
import sys

s = raw_input()
while s:
    if s[:2] != "hi":
        print "No"
        sys.exit(0)
    s = s[2:]

print "Yes"

Submission status: Accepted

Solution code:
s = str(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
if len(s) % 2:
  print("No")
  exit()
for k,i in enumerate(s):
  if k % 2:
    if i != "i":
      print("No")
      exit()
  else:
    if i != "h":
      print("No")
      exit()
print("Yes")

Submission status: Accepted

Solution code:
s=input()
lens=len(s)//2

hi="hi"*lens
if hi ==s:
  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:
def main():
  s = str(input())
  while(len(s)>=1):
    if s[:2] == 'hi':
      s = s[2:]
    else:
      print('No')
      break
  else:
    print('Yes')
  
if __name__=='__main__':
  main()

Submission status: Accepted

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:


from sys import stdin
import sys

def getInputs():
	inputs=[]
	for line in stdin:
		line=line.split()
		inputs.append(line)
	return inputs



def main(inputs):
	s=inputs[0][0]
	if len(s)%2==1:
		print("No")
		sys.exit(0)
	
	ok=True
	for i in range(0, len(s), 2):
		sub=s[i:i+2]
		if sub!="hi":
			ok=False
	if ok:
		print("Yes")
	else:
		print("No")
		
	

if __name__=="__main__":
	inputs=getInputs()
# 	inputs=simInputs()
	main(inputs)

Submission status: Accepted

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

print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()

if  len(a) % 2 == 1:
    print("No")
    exit()
if len(a) / 2 == a.count('hi'):
    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()

cand = ['hi','hihi','hihihi','hihihihi','hihihihihi']

if S in cand:
    ans = 'Yes'
else:
    ans = 'No'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

S = S.replace('hi', '')

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

Submission status: Accepted

Solution code:
s = raw_input()
n = len(s)
if n % 2 != 0:
    print 'No'
else:
    m = n / 2
    pattern = 'hi' * m
    print 'Yes' if pattern == s else 'No'

Submission status: Accepted

Solution code:
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()

cnt = S.count("hi")

print("Yes" if len(S) == cnt * 2 else "No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s=input()
n=len(s)
if n%2==0:
    for i in range(n//2):
        if s[i*2:i*2+2]!='hi':
            print('No')
            exit()
    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':
        print('No')
        exit()
print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

S = input()

if len(S) % 2 != 0:
    print('No')
else:
    for i in range(0, len(S), 2):
        if S[i] != 'h' or S[i + 1] != 'i':
            print('No')
            sys.exit()
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# import bisect
# from collections import Counter, defaultdict, deque, namedtuple
# import copy
# from heapq import heappush, heappop, heapify
# from fractions import gcd
# import itertools
# from operator import attrgetter, itemgetter
# import math

import sys

# import numpy as np

ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

def main():
    s = input()
    l = len(s)

    if l % 2 == 0:
        for i in range(l//2):
            if s[i*2:i*2+2] != "hi":
                print('No')
                sys.exit()
    else:
        print('No')
        sys.exit()

    print('Yes')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n = input()
if n == "hi" or  n == "hihi" or  n == "hihihi" or  n == "hihihihi" or  n == "hihihihihi":
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S=input()

S=S.replace('hi','')

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
def solve(s):
    if len(s) % 2 == 1:
        return "No"
    for i, x in enumerate(s):
        if i % 2 == 0 and x != "h":
            return "No"
        if i % 2 == 1 and x != "i":
            return "No"
    return "Yes"


def main():
    s = input()
    res = solve(s)
    print(res)


def test():
    assert solve("hihi") == "Yes"
    assert solve("hi") == "Yes"
    assert solve("ha") == "No"


if __name__ == "__main__":
    test()
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    S = input()
    l = len(S)
    if l % 2 != 0:
        print('No')
    elif S.count('hi') == l // 2:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()

hitachi = ['hi', 'hihi', 'hihihi', 'hihihihi', 'hihihihihi']

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

Submission status: Accepted

Solution code:
s=input()
if len(s)%2!=0:
    print('No')
    exit()
else:
    for i in range(len(s)//2):
        if not (s[2*i]=='h' and s[2*i+1]=='i'):
            print('No')
            exit()
    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()
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:
import sys
from io import StringIO
import unittest

doTest=0

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    ans = ["hi", "hihi", "hihihi", "hihihihi", "hihihihihi"]

    yn(readline().strip() in ans)

    return

if doTest==0:
    resolve()
    sys.exit()

Submission status: Accepted

Solution code:
import sys

S = input()

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

Submission status: Accepted

Solution code:
s = input()
count_ = s.count('hi')
if(count_ * 2 == len(s)):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

is_h = False
for i in range(1, 6):
    is_h = is_h or ("hi" * i == s)

print("Yes" if is_h else "No")

Submission status: Accepted

Solution code:
def main():
    YES="Yes"
    NO="No"
    S=input()
    if S=='hi' or S=='hihi' or S=='hihihi' or S=='hihihihi' or S=='hihihihihi':
        print(YES)
    else:
        print(NO)
    return

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s=input()
l=0
for i in range(5):
    if s=="hi"*(i+1):
        l=1
print("Yes")if l else print("No")

Submission status: Accepted

Solution code:
s = input()

hitachi = ''
for i in range(len(s)//2):
    hitachi += 'hi'
if hitachi == s:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input().split("hi")
if len("".join(s))>0:
  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:
a = input()
b = len(a)
ans = True
if b%2 == 1:
  ans = False
else:
  for i in range(b//2):
    if a[i*2:i*2+2] != "hi":
      ans = False
      break
print("Yes" if ans else "No")

Submission status: Accepted

Solution code:
import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7

s=input()
if len(s)%2==1:
    print("No")
    quit()

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

print("Yes")

Submission status: Accepted

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


S = input()
if len(S)%2==1:
    print('No')
else:
    for i in range(len(S)//2):
        if S[2*i]=='h' and S[2*i+1]=='i':
            None
        else:
            print('No')
            sys.exit()
    print('Yes')
    sys.exit()

Submission status: Accepted

Solution code:
#n = int(input())
s = input()
#a,b= map(int,input().split())
#da = list(map(int,input().split()))
#a = [int(input()) for i in range(n)]

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

print('No')

Submission status: Accepted

Solution code:
#!python3

iim = lambda: map(int, input().rstrip().split())

def resolve():
    s = input()
    for i in range(5):
        if s == "hi"*(i+1):
            print("Yes")
            return
    print("No")

if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
S = input()

ans = "No"
s = ""
for _ in range(len(S) // 2):
    s += "hi"
    if s == S:
        ans = "Yes"
        break
print(ans)

Submission status: Accepted

Solution code:
S = input()

c = 0
while c < 5:
    c+=1
    if S == 'hi'*c:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if s == hi or s == hi * 2 or s == hi * 3 or s == hi * 4 or s == hi * 5:
  print('Yes')
  
else:
  print('No')

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#
import sys
import math
import numpy as np
import itertools

m = input()

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

Submission status: Accepted

Solution code:
if input() in ['hi','hihi','hihihi','hihihihi','hihihihihi']:
  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:
def mi():return map(int,input().split())

# n=int(input())
# a,b=mi()
s=input()
# l=list(mi())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input().strip()
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()
print("Yes" if len(S) == 2*S.count("hi") else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re

if __name__ == '__main__':

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
S = input().strip()

hitachi = 'hi' * (len(S) // 2)

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

Submission status: Accepted

Solution code:

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

def main():
    mod=10**9+7
    S=input()
    N=len(S)
    f=0
    if S.count("hi") == N//2 and N%2==0:
        f=1 
    if f==1:
        print("Yes")
    else:
        print("No")

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]

# n = int(input())
# 
# s


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

Submission status: Accepted

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

#############
# Libraries #
#############

import math
from functools import lru_cache

#############
# Constants #
#############

MOD = 10**9 +7
INF = float('inf')

#############
# Functions #
#############

kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#############
# Main 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:
import sys
input = sys.stdin.readline
t = input()[: -1] + "hi"
S = t.split("hi")
for t in S:
  if len(t):
    print("No")
    exit(0)
print("Yes")

Submission status: Accepted

Solution code:
S = input()
N = len(S)
ok = True
if N%2 == 0:
    for i in range(N//2):
        if S[2*i:2*i+2] != "hi":
            ok = False
else:
    ok = False
print("Yes" if ok else "No")

Submission status: Accepted

Solution code:
S = input()
N = len(S)
if N % 2 == 0 and S == 'hi'*(N//2):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
hitachi = ["hi"*i for i in range(1,6)]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from math import ceil, floor
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

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

    for i in range(0,n,2):
        if s[i:i+2] == 'hi':
            continue
        else:
            print('No')
            return
    print('Yes')
    return

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input().strip()

def check(S):
	if len(S) % 2 == 0:
		for i in range(0, len(S), 2):
			if S[i] != "h" or S[i + 1] != "i":
				return False
		return True
	else:
		return False

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

Submission status: Accepted

Solution code:
s = input()

ans = False

for i in range(1, 6):
    if s == ('hi' * i):
        ans = True
        break

print('Yes' if ans else '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:
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    S = input().strip()
    if S.count("hi") > 0:
        x = S.count("hi")
        if x * 2 == len(S):
            print("Yes")
        else:
            print("No")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
t = s.replace("hi", "#")
if set(t) == {"#"}:
  print("Yes")
else:
  print("No")