Problem:


Score : 100 points

Problem Statement

A Hitachi string is a concatenation of one or more copies of the string hi.

For example, hi and hihi are Hitachi strings, while ha and hii are not.

Given a string S, determine whether S is a Hitachi string.

Constraints

The length of S is between 1 and 10 (inclusive).

S is a string consisting of lowercase English letters.

Input

Input is given from Standard Input in the following format:

S

Output

If S is a Hitachi string, print Yes; otherwise, print No.

Sample Input 1

hihi

Sample Output 1

Yes

hihi is the concatenation of two copies of hi, so it is a Hitachi string.

Sample Input 2

hi

Sample Output 2

Yes

Sample Input 3

ha

Sample Output 3

No



Sample input:
hihi


Sample output:
Yes

Submission status: Accepted

Solution code:
s = input()

compare = 'hi'

for _ in range(10):
    if s == compare:
        print('Yes')
        exit()
    compare += 'hi'

print('No')

Submission status: Accepted

Solution code:
s=input()
n=len(s)
if s=="hi"*(n//2):
  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()

print("Yes" if "".join(["hi"] * (len(s) // 2)) == s else "No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
class alphabet():
    def __init__(self, capitalize):
        self.num = dict()
        self.index = dict()
        self.abc = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n"\
            ,"o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
        if capitalize: 
            for i in range(26): self.abc[i] = self.abc[i].upper()
        for i, a in enumerate(self.abc):
            self.num[a] = i
            self.index[i] = a

def solve():
    N = input()
    i = 0
    if len(N) % 2 == 1: print("No")
    else:
        S = "hi" * (len(N) // 2)
        if S == N: print("Yes")
        else: print("No")


    
    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
s=input()
slen=len(s)
ans=""
for i in range(slen//2):
    ans+="hi"
if s==ans:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def examA():
    S = SI()
    if len(S)%2==1:
        print("No")
        return
    for i in range(len(S)//2):
        if S[i*2:i*2+2]!="hi":
            print("No")
            return
    print("Yes")
    return

def examB():
    ans = 0
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**6)

if __name__ == '__main__':
    examA()

"""

"""

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ns = lambda : stdin.readline().rstrip()
ni = lambda : int(ns())
na = lambda : list(map(int, stdin.readline().split()))
sys.setrecursionlimit(10 ** 7)

def main():
    s = ns()

    n = len(s)
    if n % 2 == 1:
        print("No")
    else:
        tmp = ""
        for i in range(n//2):
            tmp += "hi"
        if s == tmp:
            print("Yes")
        else:
            print("No")

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    s = input().rstrip()
    if len(s) % 2 != 0:
        print("No")
    else:
        f = True
        for i in range(0, len(s), 2):
            if s[i] != "h" or s[i+1] != "i":
                f = False
        if f:
            print("Yes")
        else:
            print("No")

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#!/bin/bash
''':'
docker run --rm -it -v $(cd $(dirname $0) && pwd):/vo:ro pypy:3-2.4.0 \
   /bin/bash -c "pypy3 /vo/$(basename $0) < /vo/input.txt"
exit $?
'''
import sys


def _s(): return sys.stdin.readline().strip()


def main():
    s = _s()
    hi = ["hi"*i for i in range(1, 6)]
    if s in hi:
        return "Yes"
    else:
        return "No"


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

Submission status: Accepted

Solution code:
sl = input()


while sl:
    if sl[:2] != "hi":
        print("No")
        exit()
    else:
        sl = sl[2:]
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
n = input()
k = len(n)
if len(n)%2 == 0:
  for i in range(k//2):
    if n[2*i:2*i+2] != "hi":
      break
    if i == k//2-1:
      print("Yes")
      sys.exit()
print("No")

Submission status: Accepted

Solution code:
s = input()
a = ""
judge = False
for i in range(6):
    a = a + "hi"
    if a == s:
        print("Yes")
        judge = True
        break
if judge == False:
    print("No")

Submission status: Accepted

Solution code:
s=input()
for i in range(6):
    if s=="hi"*i:
        print("Yes")
        break
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")
        break
else:
    print("Yes")

Submission status: Accepted

Solution code:
ans=[]
s="hi"
for i in range(5):
    ans.append(s)
    s+="hi"
S=input()
if S in ans:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
    S = input()
    x = "hi"
    for i in range(10):
        if S == x * i:
            print("Yes")
            return
    print("No")


solve()

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()
hitachi = 'hi'
for i in range(0, len(S), 2):
    if S[i: i + 2] != hitachi:
        print('No')
        break
else:
    print('Yes')

Submission status: Accepted

Solution code:
s = input()

bl = False
for i in range(1, 6):
    hi = "hi" * i
    if s == hi:
        bl = True

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

Submission status: Accepted

Solution code:
#!python3.4
# -*- coding: utf-8 -*-
# hitachi2020/hitachi2020_a
import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    S = i2s()
    if S.replace('hi', '') == '':
        print('Yes')
    else:
        print('No')
    return

main()

Submission status: Accepted

Solution code:
S = input()

if len(S) % 2 > 0:
    print('No')
else:
    if S[0::2].count('h') == len(S) // 2 and S[1::2].count('i') == len(S) // 2:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
S = input()
for i in range(6):
    if S == 'hi' * i:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

Solution code:
import sys

s = sys.stdin.readline().rstrip()

def main():
    l = len(s)
    if l & 1:
        return 'No'
    if s == 'hi' * (l // 2):
        return 'Yes'
    else:
        return 'No'

if __name__ == '__main__':
    ans = main()
    print(ans)

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
S = (stdin.readline().rstrip())
S=S.replace("hi","")
if S == "":
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = str(input().rstrip())
if s in ["hi"*x for x in range(1, 6)]:
    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().strip()
if s == 'hi' * (len(s) // 2):
  	print("Yes")
else:
  	print("No")

Submission status: Accepted

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

import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

S = input()
ok = True
while S:
    if S.startswith("hi"):
        S = S[2:]
    else:
        ok = False
        break
if ok:
    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()
ans = "No"
hi = "hi"
for i in range(5):
    if s == hi * (i + 1):
        ans = "Yes"
print(ans)

Submission status: Accepted

Solution code:
S = str(input())
ans = ["hi", "hihi", "hihihi", "hihihihi", "hihihihihi"]

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

Submission status: Accepted

Solution code:
import re
S=input().strip()
if re.match("(hi)*$",S):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def main():
    S = input()
    lens = len(S)//2
    if S == "hi"*lens:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()

Submission status: Accepted

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

if l % 2 == 1:
    print("No")
    exit()

real = "hi" * (l // 2)
if real == 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 _ in range(1, 6):
    if s == 'hi' * _:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

Solution code:
S = input()
hi = ['hi','hihi','hihihi','hihihihi','hihihihihi']
print('Yes'if S in hi 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:
s = input()

length = len(s)//2

ans = "hi" * length

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

Submission status: Accepted

Solution code:
import sys

s = sys.stdin.readline().strip()

if s.replace("hi", "") == "":
    print("Yes")
else:
    print("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:
import sys
sys.setrecursionlimit(1000000000)
import math
from fractions import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    # 10**6
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     # 10**6
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    num = 1
    for i in range(n, n-k, -1):
        num = num * i % modp
    den = 1
    for i in range(2, k+1):
        den = den * i % modp
    return num * get_inv(den, modp) % modp

def comb_from_list(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp

#

class UnionFindEx:
    def __init__(self, size):
        #正なら根の番号、負ならグループサイズ
        self.roots = [-1] * size
    def getRootID(self, i):
        r = self.roots[i]
        if r < 0:   #負なら根
            return i
        else:
            r = self.getRootID(r)
            self.roots[i] = r
            return r
    def getGroupSize(self, i):
        return -self.roots[self.getRootID(i)]
    def connect(self, i, j):
        r1, r2 = self.getRootID(i), self.getRootID(j)
        if r1 == r2:
            return False
        if self.getGroupSize(r1) < self.getGroupSize(r2):
            r1, r2 = r2, r1
        self.roots[r1] += self.roots[r2]    #サイズ更新
        self.roots[r2] = r1
        return True

def main():
    S = input()
    for i in range(1, 100):
        if S == ('hi'*i):
            print('Yes')
            return
    print('No')

main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(4100000)

import math

import logging

logging.basicConfig(level=logging.DEBUG)

logger = logging.getLogger(__name__)


def resolve():
    S = [x for x in sys.stdin.readline().split()][0]  # 文字列 一つ
    # N = [int(x) for x in sys.stdin.readline().split()][0]  # int 一つ
    # N, D = [int(x) for x in sys.stdin.readline().split()]  # 複数int
    # h_list = [int(x) for x in sys.stdin.readline().split()]  # 複数int

    # grid = [list(sys.stdin.readline().split()[0]) for _ in range(N)]  # 文字列grid
    # v_list = [int(sys.stdin.readline().split()[0]) for _ in range(N)]
    # grid = [[int(x) for x in sys.stdin.readline().split()]
    #         for _ in range(N)]  # int grid

    logger.debug('{}'.format([]))

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

    print('No')


if __name__ == "__main__":
    resolve()

# AtCoder Unit Test で自動生成できる, 最後のunittest.main は消す
# python -m unittest template/template.py で実行できる
# pypy3 -m unittest template/template.py で実行できる

import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """hihi"""
        output = """Yes"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """hi"""
        output = """Yes"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """ha"""
        output = """No"""
        self.assertIO(input, output)

Submission status: Accepted

Solution code:
s=input()
ans="No"
for i in range(1,6):
    if s=="hi"*i:
    	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:
from sys import stdin
s = stdin.readline().rstrip()
k = len(s)
if k%2 == 1:
    print("No")
else:
    if s == "hi"*(k//2):
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
def main():
    #from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**9)
    #r = input()
    #n = int(input())
    #a, b = map(int, input().split())
    #s, y = input().split()
    #a = input().split()
    #a = list(map(int, input().split()))
    #a = [input().split() for i in range(n)]
    #a = [int(input()) for i in range(n)]
    #a = [list(map(int, input().split())) for i in range(n)]
    #a = [int(s) - 1 for s in input().split()]
    #l=[int(input()) for _ in range(int(input()))]
    #res = 0

    s = input()
    hi = ['hi','hihi','hihihi','hihihihi','hihihihihi']
    for i in hi:
        if s == i:
            print('Yes')
            return 0
    print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    S = input()
    len_S = len(S)
    cnt = S.count('hi')
    if cnt * 2 == len_S:
        print('Yes')
    else:
        print('No')
    

if __name__ == "__main__":
    main()

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:
#!/usr/bin/env python3
import sys

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


def solve(S: str):
    if len(S)%2 == 1:
        print(NO)
        return
    
    for i in range(len(S)//2):
        j = 2*i
        if S[j:j+2] == "hi":
            continue
        else:
            print(NO)
            return
    print(YES)
    return


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

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

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

s = input()
n = len(s)
if n %2: print('No'); quit()
for i in range(n//2)[::2]:
    if s[i] == 'h' and s[i+1] == 'i':
        continue
    print('No')
    quit()
print('Yes')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(S):
    if len(S) % 2 != 0:
        return 'No'
    if S == 'hi' * (len(S) // 2):
        return 'Yes'
    return 'No'


def main():
    S = read_str()
    print(slv(S))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
cont = len(s)//2
if s == "hi"*cont:
    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:
def main():
    import sys
    input = sys.stdin.readline

    S = input().rstrip('\n')
    N = len(S)
    if N&1:
        print('No')
        exit()
    for i in range(N):
        if i&1:
            if S[i] != 'i':
                print('No')
                exit()
        else:
            if S[i] != 'h':
                print('No')
                exit()
    print('Yes')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:

S = input()

flag = True
if len(S) % 2 == 1:
    flag = False
else:

    for i in range(0,len(S),2):

        if S[i] + S[i+1] != "hi":
            flag = False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

s = input()
m= "hi"
# for i in range():
l = len(s) // 2
if l * m == s:
    print("Yes")
else:
    print("No")

# if s // 2

Submission status: Accepted

Solution code:
S=input()
a=False
for i in range(10):
    if S=='hi'*i:
        a=True
print('Yes' if a else 'No')

Submission status: Accepted

Solution code:
S = input()
T = S.split('hi')
if len(set(T))==1 and T[0]=='':
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
#list(map(int,input().split()))
s=input()
n=len(s)
if n%2==1:
    print("No")
else:
    ans="Yes"
    for i in range(n):
        if i%2==1 and s[i]!="i":
            ans="No"
        if i%2==0 and s[i]!="h":
            ans="No"
    print(ans)

Submission status: Accepted

Solution code:
a = input()
b = ['hi','hihi','hihihi','hihihihi','hihihihihi']

if a in b:
	print("Yes")
else:
	print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

Submission status: Accepted

Solution code:
def main():
    a = input()
    if a in ["hi", "hi"*2, "hi"*3, "hi"*4, "hi"*5]:
        print("Yes")
    else:
        print("No")


main()

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 sys
s = input()
for i in range(1, 6):
    if s == "hi"*i:
        print("Yes")
        sys.exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
a = "No"
for i in range(1, 11):
    if S == "hi"*i:
        a = "Yes"
print(a)

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 S =="":
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = raw_input()

candidates = []
candi = ""
for i in range(5):
    candi += "hi"
    candidates.append(candi)

if S in candidates:
    print "Yes"
else:
    print "No"

Submission status: Accepted

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


def main():
    s = input()
    s = s.replace('hi', '')

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=str(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:
import sys
sys.setrecursionlimit(700000)

def s_in():
    return input()

def n_in():
    return int(input())

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

def print_l(l):
    print(' '.join(map(str, l)))

class Interval():
    def __init__(self, li):
        self.li = li
        self.n = len(li)
        self.sum_li = [li[0]]
        for i in range(1, self.n):
            self.sum_li.append(self.sum_li[i-1] + li[i])

    def sum(self, a, b=None):
        if b is None:
            return self.sum(0, a)

        res = self.sum_li[min(self.n-1, b-1)]
        if a > 0:
            res -= self.sum_li[a-1]
        return res

if s_in() in ['hi', 'hi'*2, 'hi'*3, 'hi'*4, 'hi'*5]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

def main():
    s = input()
    if s == 'hi':
        print('Yes')
        return
    if s == 'hihi':
        print('Yes')
        return
    if s == 'hihihi':
        print('Yes')
        return
    if s == 'hihihihi':
        print('Yes')
        return
    if s == 'hihihihihi':
        print('Yes')
        return
    print('No')
    
if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

s = input()
if len(s) % 2 != 0:
  print("No")
  exit()
else:
  for i in range(0,len(s),2):
    if not (s[i] == "h" and s[i+1] == "i"):
      print("No")
      exit()
print("Yes")

Submission status: Accepted

Solution code:
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=998244353
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  s=S()
  if len(s)%2==1:
    return 'No'
  if len(s)//2==s.count('hi'):
    return 'Yes'
  return 'No'

# main()
print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print('Yes')

Submission status: Accepted

Solution code:
def main():

    S = input()
    for i in range(1, 10):
        if S == 'hi'*i:
            return 'Yes'
    return 'No'

if __name__ == '__main__':
    print(main())