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:
# hitachi2020 A

def main():
    s = input()

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()

i = 0

while S[i:i + 2] == 'hi':
  i += 2

print('Yes' if i == len(S) else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 7)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

S = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

else:
    if 'hi'*(num//2)==s:
        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()
for i in range(1, 6):
    if "hi" * i == S:
        print("Yes")
        break
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:
def f():
  s = input()
  l = len(s)
  if l%2:
    print('No')
    return
  for i in range(l//2):
    if s[2*i]!='h' or s[2*i+1]!='i':
        print('No')
        return
  print('Yes')
f()

Submission status: Accepted

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

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()
if s.count('hi')==(len(s)+1)//2:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def solve(inp):
    S = inp.readline().strip()

    for i in range(0, len(S), 2):
        if S[i:i + 2] != "hi":
            return "No"
    return "Yes"


def main():
    import sys
    result = solve(sys.stdin)
    if result is not None and result != '':
        print(result)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()

hi_cnt = s.count('hi')

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

import sys
from collections import Counter

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

S = input()
N = len(S)

if N % 2 == 1:
    No()
    exit()

for i in range(0, N, 2):
    if S[i] != 'h' or S[i+1] != 'i':
        No()
        exit()
Yes()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(S: str):
    if len(S)%2 != 0:
        print(NO)
    else:
        for i in range(len(S)):
            if i % 2 == 0 and S[i] != "h":
                print(NO)
                return
            if i % 2 == 1 and S[i] != "i":
                print(NO)
                return
        print(YES)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()

ans={'hi','hihi','hihihi','hihihihi','hihihihihi'}

for i in ans:
    if i == S:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

Solution code:
s = input()

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

i = 0
while True:
    if i > len(s) - 2:
        break
    target = s[i:i+2]
    if target != "hi":
        print("No")
        exit()
    i += 2
print("Yes")

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
S = input().strip()
if len(S) % 2 != 0:
    print('No')
    exit()
for i in range(0, len(S)-1, 2):
    if S[i:i+2] == 'hi':
        continue
    else:
        print('No')
        exit()
else:
    print('Yes')

Submission status: Accepted

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

    sc = s.count('h')
    sh = s.count('i')

    if sc != sh:
        print('No')
        exit()

    for i in range(len(s)):
        if i % 2 == 0:
            if s[i] != 'h':
                break
        else:
            if s[i] != 'i':
                break
    else:
        print('Yes')
        exit()

    print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = str(input())

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

Submission status: Accepted

Solution code:
S=input()
print("Yes" if S=="hi" or S=="hihi" or S=="hihihi" or S=="hihihihi" or S=="hihihihihi" else "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:
def main():
    s = input()
    pattern = 'hi'
    result = s.replace(pattern, '')
    if len(result) == 0:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

    print('Yes')

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
S = input()
print("Yes" if "hi" * (len(S)//2) == S else "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:
# -*- coding: utf-8 -*-
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().replace("hi","")
print("Yes" if s == "" else "No")

Submission status: Accepted

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

def f(S):
    if len(S)%2 != 0:
        return False

    for i in range(0, len(S), 2):
        if S[i:i+2] != 'hi':
            return False

    return True


S = input()
print('Yes' if f(S) else 'No')

Submission status: Accepted

Solution code:
S=input()
mode=0
for s in S:
  if mode==0 and s=='h':
    mode+=1
  elif mode==1 and s=='i':
    mode=(mode+1)%2
  else:
    print('No')
    exit(0)
if mode==0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

c = 'hi' * int(len(s)/2)

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

Submission status: Accepted

Solution code:
#coding:utf-8

import queue



def main():
    s = input()
    t = ''
    for _ in range(10):
        t += 'hi'
        if t == s:
            print('Yes')
            break
    else:
        print('No')
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from sys import exit

S = input()

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

for i, s in enumerate(S):
    if i % 2 == 0:
        if s != "h":
            print("No")
            exit()
    else:
        if s != "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 in ('hi', 'hihi', 'hihihi', 'hihihihi', 'hihihihihi'):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
flag = 0
f = True
for i in range(len(s)):
    if s[i] == "h" and flag == 0:
        flag = 1
        continue
    if s[i] == "i" and flag == 1:
        flag = 0
        continue
    else:
        f = False
if f is False or flag != 0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
string = input()

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

for i in range(0, 10, 2):
    if len(string) > i:
        if string[i] != 'h' or string[i + 1] != 'i':
            print("No")
            exit()

print("Yes")

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
def main():

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

  for i in range(len(S)):
    if i%2==0:
      if S[i]!='h':
        print('No')
        return
    else:
      if S[i]!='i':
        print('No')
        return
  print('Yes')
  return

main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())

if S[-1] != 'i' or S[0] != 'h':
    print('No')
    exit()

pre = 'i'
for s in S:
    if pre == 'i' and s == 'h':
        pre = 'h'
    elif pre == 'h' and s == 'i':
        pre = 'i'
    else:
        print('No')
        exit()

print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
n = len(S) // 2

if 'hi' * n == S:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import sys
s=input()
sgn=1
if len(s)%2==0:
    for i in range(len(s)):
        if i%2==0:
            if s[i]!="h": sgn=0
        else:
            if s[i]!="i": sgn=0

else:
    sgn=0
print("Yes" if sgn==1 else "No")

Submission status: Accepted

Solution code:
import math
from collections import deque
def main():
    s = input()
    if(len(s)%2!=0):
        print("No")
        return

    for i,c in enumerate(s):
        if i%2==0:
            if c!='h':
                print("No")
                return
        else:
            if c!='i':
                print("No")
                return

    print("Yes")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# print('input >>')
S = input()

if S == 'hi' or S == 'hihi' or S == 'hihihi' or S == 'hihihihi' or S == 'hihihihihi':
    print('Yes')

else:
    print('No')

# print('-----output-----')

Submission status: Accepted

Solution code:
S = input()

if S == "hi":
    print("Yes")
    exit()
if S == "hihi":
    print("Yes")
    exit()
if S == "hihihi":
    print("Yes")
    exit()
if S == "hihihihi":
    print("Yes")
    exit()
if S == "hihihihihi":
    print("Yes")
    exit()
    
print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

ans = "No"
for i in range(1,10):
	if s==("hi")*i:
		ans="Yes"
		break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

s = input()
s = s.replace('\n','')
s = s.replace('hi','')

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

Submission status: Accepted

Solution code:
# import sys
# import math
# import decimal
# import queue
# import bisect
# import heapq
# import time
# import itertools
# import collections # queue
# from fractions import Fraction

mod = int(1e9+7)
INF = 1<<29
lINF = 1<<35

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

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
from sys import stdin
n = stdin.readline().rstrip()
if n == "hi":
    print('Yes')
elif n == "hihi":
    print('Yes')
elif n == "hihihi":
    print('Yes')
elif n == "hihihihi":
    print('Yes')
elif n == "hihihihihi":
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#for _ in range(int(input())):
s = input()
if len(s)%2==0:
    if s=="hi"*int(len(s)/2):
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    s = input()

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

    if s == 'hi':
        print('Yes')
        exit()
    if s == 'hihi':
        print('Yes')
        exit()
    if s == 'hihihi':
        print('Yes')
        exit()
    if s == 'hihihihi':
        print('Yes')
        exit()
    if s == 'hihihihihi':
        print('Yes')
        exit()

    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()
S = S.replace("hi","")
if len(S) == 0:
    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 len(S) % 2 != 0:
  print("No")
else:
  N = len(S)
  p = 0
  for i in range(0, N, 2):
    if S[i:i+2] != 'hi':
      p += 1
  if p == 0:
    print("Yes")
  else:
    print("No")

Submission status: Accepted

Solution code:
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

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

Submission status: Accepted

Solution code:
S = input()
t = 0
s = ['h', 'i']
if len(S)%2==1:
    print("No")
    quit()
for i in S:
    if i!=s[t]:
        print("No")
        quit()
    t ^= 1

print("Yes")

Submission status: Accepted

Solution code:
S = input()
ans = 'Yes'
while len(S)>0:
  if S[:2]!='hi':
    ans = 'No'
    break
  S = S[2:]
print(ans)

Submission status: Accepted

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

def main():
    s = input()
    if len(s)%2 != 0:
        print("No")
        exit()
    for i in range(len(s)//2):
        if s[2*i:2*i+2] != "hi":
            print("No")
            exit()
    print("Yes")
    
if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement, groupby
from math import sqrt, factorial, log
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heappushpop
import sys
stdin = sys.stdin
mod = 10**9 + 7

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

a = list()
for i in range(1, 6):
    a.append("hi"*i)
s = ns()
if s in a:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re

pattern = re.compile("(hi)+")
s = input()
print("Yes" if pattern.fullmatch(s) else "No")

Submission status: Accepted

Solution code:
def main():
    s = list(input())
    flg = 'h'
    for i, a in enumerate(s):
        if a == flg:
            if flg == 'h':
                flg = 'i'
            elif flg == 'i':
                flg = 'h'
            else:
                print('No')
                return
        else:
            print('No')
            return
    if flg == 'h':
        print('Yes')
    else:
        print('No')
if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
s=input()

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

ans = 'No'

for i in range(6):
    if S == 'hi' * i:
        ans = 'Yes'
        break

print(ans)

Submission status: Accepted

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

import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
read = sys.stdin.read


#n,a = [int(i) for i in read().split()]

s = input()
s = s.replace("hi","X")
if len(set(s)) == 1 and s[0]=="X":
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

S = sr()
if len(S)%2 == 1:
    print('No'); exit()

for i in range(len(S)//2):
    if S[2*i:2*(i+1)] != 'hi':
        print('No'); exit()

print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, math
def input():
    return sys.stdin.readline()[:-1]
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial
from bisect import bisect_left #bisect_left(list, value)
#from fractions import gcd
enu = enumerate

sys.setrecursionlimit(10**7)
S = input()

for i in range(6):
    if 'hi'*i == S:
        print('Yes')
        exit()
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:
#!python3.4.3

s = input()

v = [s[i: i+2] for i in range(0, len(s), 2)]

for t in v:
  if t != 'hi':
    print('No')
    exit()

print('Yes')

Submission status: Accepted

Solution code:
S = input()
l = len(S)
s = ""
if l%2 != 0:
  print("No")
else:
  for i in range(l//2):
    s += "hi"
  if S == s:
    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)):
        if i%2==0 and S[i]=='h':
            continue
        elif i%2!=0 and S[i]=='i':
            continue
        print('No')
        exit()
print('Yes')

Submission status: Accepted

Solution code:
# 日立コン
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)

S = readline().strip().decode("utf-8")

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

Submission status: Accepted

Solution code:
s=input()

test=["hi"*i for i in range(10)]

ans="No"
for t in test:
    if s==t:
        ans="Yes"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
def main():
	readline=stdin.readline
	S=readline().strip()
	hflag=False
	iflag=True
	for i in range(len(S)):
		if S[i]=="h" and iflag:
			hflag=True
			iflag=False
		elif S[i]=="i" and hflag:
			iflag=True
			hflag=False
		else:
			print("No")
			break
	else:
		if hflag==False and iflag:
			print("Yes")
		else:
			print("No")
if __name__=="__main__":
	main()

Submission status: Accepted

Solution code:
S=input()

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

if len(S)%2==0:
  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()
his = ['hi'* i for i in [1, 2, 3, 4, 5]]

if S in his:
    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:
#!/usr/bin/env python
# coding: utf-8

def ri():
    return int(input())

def rl():
    return list(input().split())

def rli():
    return list(map(int, input().split()))

def main():
    s = input()
    if len(s) % 2 == 1:
        print("No")
        return
    for i in range(len(s)//2):
        if s[2*i:2*i+2] != 'hi':
            print("No")
            return
    print("Yes")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

s = input().split()[0]

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

Submission status: Accepted

Solution code:
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353


S = sys.stdin.buffer.readline().decode().rstrip()
ok=False
for i in range(1,6):
    ok  |= S == 'hi' * i
if ok:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:

def main():
    s = input()
    s2 = ""
    answer = "No"
    for i in range(20):
        s2 = "hi" * i
        if s == s2:
            answer = "Yes"
            break
    print(answer)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
s = list(input())
Flg = True
if len(s) % 2 == 1:
    Flg = False
for i in range(len(s)-1):
    if i % 2 == 0:
        if s[i] == 'h' and s[i+1] == 'i':
            pass
        else:
            Flg = False
if Flg:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# じょえチャンネルおもしろいよ～～～
# https://www.youtube.com/channel/UCRXsI3FL_kvaVL9zoolBfbQ

Hitachi="Hitachi"
hitachi="hitachi"

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

Submission status: Accepted

Solution code:
s = input()
chars = s.split('hi')

for char in chars:
    if len(char) > 0:
        print('No')
        exit(0)
print('Yes')

Submission status: Accepted

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