Harryxun/stf_run huggingface dataset:
n, k = map(int, input().split())                                         |n = int(input())
h = list(map(int, input().split()))                                      |h = list(map(int, input().split()))
dp = [0] * n                                                             |dp = [0]*n
                                                                         |
for i in range(n):                                                       |for i in range(n):
    if i == 0:                                                           |    if i == 0:
        dp[0] = 0                                                        |        dp[0] = 0
    elif i == 1:                                                         |    elif i == 1:
        dp[1] = abs(h[0]-h[1])                                           |        dp[1] = abs(h[0]-h[1])
    else:                                                                |    else:
        costs = []                                                       |        cost1 = dp[i-1] + abs(h[i-1]-h[i])
        for j in range(1, k+1):                                          |        cost2 = dp[i-2] + abs(h[i-2]-h[i])
            if j > i:                                                    |        dp[i] = min(cost1, cost2)
                break                                                    |
            if abs(h[i-j]-h[i]) == 0:                                    |print(dp[n-1])
                costs.append(dp[i-j])                                    |
                break                                                    |
            costs.append(dp[i-j] + abs(h[i-j]-h[i]))                     |
                                                                         |
        # if i == 3:                                                     |
        #     print(costs)                                               |
        dp[i] = min(costs)                                               |
                                                                         |
#print(dp)                                                               |
print(dp[n-1])                                                           |
                                                                         |


### FIXED CODE ###

n, k = map(int, input().split())
h = list(map(int, input().split()))
dp = [0] * n

for i in range(n):
    if i == 0:
        dp[0] = 0
    elif i == 1:
        dp[1] = abs(h[0]-h[1])
    else:
        costs = []
        for j in range(1, k+1):
            if j > i:
                break
            if abs(h[i-j]-h[i]) == 0:
                costs.append(dp[i-j])
                break
            costs.append(dp[i-j] + abs(h[i-j]-h[i]))

        # if i == 3:
        #     print(costs)
        dp[i] = min(costs)

#print(dp)
print(dp[n-1])
n=input()
#lst=list(n)
#print(lst)
s=0
for i in lst:
    s+=int(i)
if s%9==0:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

n=input()
lst=list(n)
#print(lst)
s=0
for i in lst:
    s+=int(i)
if s%9==0:
    print('Yes')
else:
    print('No')
N, K, S = map(int, input().split())

array = [0] * N
if S % 2 == 0:
    for i in range(K+1):
        array[i] = S//2
    print(*array)
else:
    for i in range(0, K+1, 2):
        array[i] = (S-1) //2
        array[i+1] = (S+1)  // 2
    print(*array)

### FIXED CODE ###

N, K, S = map(int, input().split())

if S != 10 **9:
    N = [S+1] * N    
else:
    N = [1] * N

for i in range(K):
        N[i] = S

print(*N)
def main():
    N, Q = map(int, input().split())
    s = input()
    l = []
    for _ in range(Q):
        t, d = input().split()
        l.append((t, d))
    lmax = N + 1
    lmin = 0
    rmax = N + 1
    rmin = 0
    # find most left R
    t = N
    for i in range(Q):
        if s[t-1] == l[i][0]:
            if l[i][1] == 'L':
                t -= 1
            else:
                t += 1
        if t == N+1:
            break
    else:
        rmin = N + 1
    while rmax != rmin:
        m = t = (rmax + rmin) // 2
        for i in range(Q):
            if s[t-1] == l[i][0]:
                if l[i][1] == 'L':
                    t -= 1
                else:
                    t += 1
            if t == N+1:
                rmax = m
                break
        else:
            rmin = m + 1
    t = 1
    for i in range(Q):
        if s[t-1] == l[i][0]:
            if l[i][1] == 'L':
                t -= 1
            else:
                t += 1
        if t == 0:
            break
    else:
        lmax = 0
 
    # find most right L
    while lmax != lmin:
        m = t = (lmax + lmin + 1) // 2
        for i in range(Q):
            if s[t-1] == l[i][0]:
                if l[i][1] == 'L':
                    t -= 1
                else:
                    t += 1
            if t == 0:
                lmin = m
                break
        else:
            lmax = m - 1
    print(rmax-lmax-1)
main()


### FIXED CODE ###

def main():
    N, Q = map(int, input().split())
    s = input()
    l = []
    for _ in range(Q):
        t, d = input().split()
        l.append((t, d))
    lmax = N + 1
    lmin = 0
    rmax = N + 1
    rmin = 0
    # find most left R
    t = N
    for i in range(Q):
        if s[t-1] == l[i][0]:
            if l[i][1] == 'L':
                t -= 1
            else:
                t += 1
        if t == N+1:
            break
        if t == 0:
            print('0')
            return 0
    else:
        rmin = N + 1
    while rmax != rmin:
        m = t = (rmax + rmin) // 2
        for i in range(Q):
            if s[t-1] == l[i][0]:
                if l[i][1] == 'L':
                    t -= 1
                else:
                    t += 1
            if t == N+1:
                rmax = m
                break
            if t == 0:
                rmin = m + 1
                break
        else:
            rmin = m + 1
    t = 1
    for i in range(Q):
        if s[t-1] == l[i][0]:
            if l[i][1] == 'L':
                t -= 1
            else:
                t += 1
        if t == 0:
            break
        if t == N + 1:
            print('0')
            return 0
    else:
        lmax = 0
 
    # find most right L
    while lmax != lmin:
        m = t = (lmax + lmin + 1) // 2
        for i in range(Q):
            if s[t-1] == l[i][0]:
                if l[i][1] == 'L':
                    t -= 1
                else:
                    t += 1
            if t == 0:
                lmin = m
                break
            if t == N + 1:
                lmax = m - 1
                break
        else:
            lmax = m - 1
    print(rmax-lmax-1)
main()
n = int(input())
count = 0
for i in range(n):
  x, y = input().split()
  if y == 'JPY':
    x = int(x)
  else:
    x = int(x) * 3.8e5
  count += x
print(x)

### FIXED CODE ###

n = int(input())
count = 0
for i in range(n):
  x, y = input().split()
  if y == 'JPY':
    x = int(x)
  else:
    x = float(x) * 3.8e5
  count += x
print(count)
line = input()
num_a, num_b, num_c, num_k = [int(n) for n in line.split()][0]
numbers = [num_a, num_b, num_c]
numbers.sort(reverse=True)
numbers[0] *= 2**num_k
print(sum(numbers))

### FIXED CODE ###

num = input()
A = int(num.split(' ')[0])
B = int(num.split(' ')[1])
C = int(num.split(' ')[2])
K = int(input())
num = [A,B,C]
while K>0:

    posi = num.index(max(num))
    num[posi]=num[posi]*2

    K=K-1

print(sum(num))
n=int(input())
d=sorted(list(map(int,input().split())))

print(int(d[(n//2)+1]-d[(n//2)]))

### FIXED CODE ###

n = int(input())
d = sorted(list(map(int,input().split())))

print(d[n//2]-d[n//2-1])
A,B=map(int,input().split())

import math
print(A*B//math.gcd(A,B))

### FIXED CODE ###

A,B=map(int,input().split())

import fractions
print(A*B//fractions.gcd(A,B))
from scipy.special import comb
mod = 10**9 + 7
N, K = map(int,input().split())
for i in range(1,K+1):
    a = K-i
    b = i-1
    c = N-(i-1)-K
    d = i
    print(comb(a+b,b,exact=True)*comb(c+d,d,exact=True)%mod)


### FIXED CODE ###

from scipy.special import comb
mod = 10**9 + 7
N, K = map(int,input().split())
for i in range(1,K+1):
    a = K-i
    b = i-1
    c = N-(i-1)-K
    d = i
    print(comb(a+b,b,exact=True)*comb(c+d,d,exact=True)%mod)
n = int(input())
a = list(map(int, input().split()))

if n == 1:
    print(1)
    exit()
elif n == 2:
    if abs(a[0] - a[1]) <= 2:
        print(2)
        exit()
    else:
        print(1)
        exit()

al = [0]*(max(a)+1)
for i in a:
    al[i] += 1
index = al.index(max(al))

if index == min(a):
    index += 1
elif index == max(a):
    index -= 1

print(al[index-1] + al[index] + al[index+1])


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
al = [0]*(10**5+2)

for i in a:
    al[i] += 1
    al[i+1] += 1
    al[i+2] += 1

print(max(al))
s = input()
for sz in [3, 5, 7, 9, 11, 13, 15, 17, 19, 21]
    if sz > len(s):
        break
    for i in range(len(s) - sz + 1):
        curr = s[i:i + sz]
        for it in curr:
            if curr.count(it) > sz // 2:
                print(i + 1, i + sz)
                exit(0)
print("-1 -1")


### FIXED CODE ###

s = input()
for i in range(len(s) - 1):
    if s[i] == s[i + 1]:
        print(i + 1, i + 2)
        exit(0)
for sz in range(3, 4, 2):
    if sz > len(s):
        break
    for i in range(len(s) - sz + 1):
        curr = s[i:i + sz]
        for it in curr:
            if curr.count(it) > sz // 2:
                print(i + 1, i + sz)
                exit(0)
print("-1 -1")
# 未完成
import numpy as np
N = int(input())
x = np.zeros(N)
y = np.zeros(N)
kouhokist = []

for i in range(N):
    x[i], y[i] = map(int, input().split())
ans = []
for m in range(N):
    for p in range(N):
        if m == p:
            continue
        diff_x = x[m] - x[p]
        diff_y = y[m] - y[p]
        ans_kari = 0
        for r in range(N):
            for q in range(N):
                if r == q:
                    continue
                if x[q] - x[r] == diff_x and y[q] - y[r] == diff_y:
                    ans_kari += 1
        ans.append(ans_kari)

print("{}".format(N-max(ans)))


### FIXED CODE ###

# 未完成

import sys
N = int(input())
x = [0]*N
y = [0]*N
kouholist = []
ans = N
if N == 1:
    print(1)
    sys.exit()

for i in range(N):
    x[i], y[i] = map(int, input().split())
for m in range(N):
    for p in range(N):
        if m == p:
            continue
        diff_x = x[m] - x[p]
        diff_y = y[m] - y[p]
        ans_kari = N
        for r in range(N):
            for q in range(N):
                if x[q] - x[r] == diff_x and y[q] - y[r] == diff_y:
                    ans_kari -= 1
        if ans_kari < ans:
            ans = ans_kari

print("{}".format(ans))
s=input()
be=s[:2]
af=s[2:]

if s=="0000":
  print("NA")
  
if be=="00" or af=="00":
  if int(af)<=12:
    if af=="00":
      print("NA")
    else:
      print("YYMM")
      
  elif int(be)<=12:
  if be=="00":
    print("NA")
  else:
    print("MMYY")

elif int(be)<=12 and int(af)<=12:   
    print("AMBIGUOUS")
  
else:
  print("NA")

### FIXED CODE ###

s=input()
be=s[:2]
af=s[2:]

if s=="0000":
  print("NA")

elif int(be)<=12 and int(af)<=12 and be!="00" and af!="00":
  print("AMBIGUOUS")

elif int(af)<=12 and af!="00":
    print("YYMM")
    
elif int(be)<=12 and be!="00":
    print("MMYY")
  
else:
  print("NA")
a, b = map(int, input().split())
if a>b:
  print("GREATER")
elif a<b:
  print("LESS")
else:
  print("EQUAL")

### FIXED CODE ###

a = int(input())
b = int(input())
if a>b:
  print("GREATER")
elif a<b:
  print("LESS")
else:
  print("EQUAL")
from collections import defaultdict
n=int(input())
routes=[tuple(map(int,input().split())) for i in range(n-1)]

edges=defaultdict(list)
for v1,v2,dist in routes:
  edges[v1-1].append([v2-1,dist])
  edges[v2-1].append([v1-1,dist])
#print(edges)

ans=[-1]*n
ans[0]=0

def dfs(i):
  if ans[i]!=-1:
    return ans[i]
  else:
    for edge in edges[i]:
      v=edge[0]
      dist=edge[1]
      ans[i]=dfs(v)+dist
      return ans[i]
for i in range(n):
  dfs(i)
  
print(*[ans[i]%2 for i in range(n)],sep='\n')


### FIXED CODE ###

from collections import deque,defaultdict
n=int(input())
routes=[tuple(map(int,input().split())) for i in range(n-1)]

edges=defaultdict(list)
for v1,v2,dist in routes:
  edges[v1-1].append([v2-1,dist])
  edges[v2-1].append([v1-1,dist])
#print(edges)

ans=[0]*n
q=deque([0])
while q:
  v=q.popleft()
  #print(v)
  if ans[v]==0:
    color=[1,0]
  else:
    color=[0,1]
  #print(edges)
  for edge in edges[v]:
    v2=edge[0]
    dist=edge[1]
    edges[v2].remove([v,dist])
    q.append(v2)
    if dist%2==1:
      ans[v2]=color[0]
    else:
      ans[v2]=color[1]
      
print(*ans,sep='\n')
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = bin(i).find("1") - 1
print(round(ans))

### FIXED CODE ###

print(input().count("1"))
for i in range(3000):
    a, b = map(int, input().split())
    if a <= b:
        print(a, b)
    else:
        print(b, a)


### FIXED CODE ###

for i in range(3000):
    a, b = map(int, input().split())
    if a == 0 and b == 0:
        break
    if a <= b:
        print(a, b)
    else:
        print(b, a)
s=input()
d=s.replace("x","")
rd=d[::-1]
if d!=rd:print(-1)
else:
    ans=0
    x,y=0,len(s)-1
    while abs(x-y)>0:
        if s[x]==s[y]:x+=1;y-=1
        elif s[x]=="x":ans+=1;x+=1
        else:ans+=1;y-=1
    print(ans)

### FIXED CODE ###

s=input()
d=s.replace("x","")
rd=d[::-1]
if d!=rd:print(-1)
else:
    ans=0
    x,y=0,len(s)-1
    while y-x>0:
        if s[x]==s[y]:
            x+=1;y-=1
        elif s[x]=="x":
            ans+=1;x+=1
        else:
            ans+=1;y-=1
    print(ans)
'''
INPUT SHORTCUTS
N, K = map(int,input().split())
N ,A,B = map(int,input().split())
string = str(input())
arr = list(map(int,input().split()))
N = int(input())
'''

N = int(input())
arr = list(map(int,input().split()))
arr.sort()
ans = 0
for i in range(N-1):
	if arr[i]==arr[i+1]:
		ans = 1
        break

if ans:
	print("NO")
else:
	print("YES")




### FIXED CODE ###

'''
INPUT SHORTCUTS
N, K = map(int,input().split())
N ,A,B = map(int,input().split())
string = str(input())
arr = list(map(int,input().split()))
N = int(input())
'''

N = int(input())
arr = list(map(int,input().split()))
arr.sort()
ans = 0
for i in range(N-1):
	if arr[i]==arr[i+1]:
		ans = 1
		break

if ans:
	print("NO")
else:
	print("YES")
n = (int)(input())
s = []
t = []
for _ in range(n):
    a, b = (list)(map(int, input().split()))
    s.append(a)
    t.append(b)
mi = min(s)
ma = max(t)


def primeList(N):
    max = int(N//2)+5
    seachList = [i for i in range(2, N+1)]
    primeNum = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum


def prime(s, t):
    primes = primeList(t)
    l = [0]*(t+1)
    c = 0
    s = 0
    for i in range(s, t+1):
        if i in primes and (i+1)//2 in primes:
            c += 1
        l[i] = c
    return l


primes = prime(mi, ma)
for i in range(n):
    print(primes[t[i]] - primes[s[i]-1])


### FIXED CODE ###

from itertools import accumulate

N = 100000
prime = [True]*(N+1)

prime[0] = prime[1] = False

for i in range(N+1):
    if prime[i]:
        for j in range(2*i, N+1, i):
            prime[j] = False

prime2 = [0] * (N+1)

for i in range(N+1):
    if prime[i] and prime[(i+1)//2]:
        prime2[i] = 1

acc = list(accumulate(prime2))

Q = int(input())
for _ in range(Q):
    l, r = map(int, input().split())
    print(acc[r]-acc[l-1])
def comb(x,y):
    if y==1:
        return x
    elif y==2:
        return max(x*(x-1)//2, 0)
    elif y==3:
        return max(x*(x-1)*(x-2)//6, 0)


n = int(input())
k = int(input())
digit = len(str(n))
ans1 = comb(digit-1, k) * (9**k)
lst = [int(i) for i in list(str(n))]
if k==1:
    ans2 = lst[0]
elif k==2:
    ans2 = 0
    ans2 += (lst[0]-1) * (digit-1) * 9
    ans2 += lst[1] + (digit-2)*9
elif k==3:
    ans2 = 0
    ans2 += (lst[0]-1) * comb(digit-1, 2) * (9*2)
    ans2 += lst[1]*(digit-2)*9 + comb(digit-2, 2)*(9**2)
print(ans1+ans2)

### FIXED CODE ###

n = input()
k = int(input())

# dp[i桁まで][非0個数][未満フラグ]
dp = [[[0]*2 for _ in range(k+1)] for _ in range(len(n)+1)]
dp[0][0][0] = 1

for i in range(len(n)):
    x = int(n[i])
    for j in range(k):
        dp[i+1][j+1][1] += dp[i][j][1]*9
        dp[i+1][j][1] += dp[i][j][1]
        if x>0:
            dp[i+1][j][1] += dp[i][j][0]
            dp[i+1][j+1][1] += dp[i][j][0]*(x-1)
            dp[i+1][j+1][0] += dp[i][j][0]
        else:
            dp[i+1][j][0] += dp[i][j][0]
    dp[i+1][k][1] += dp[i][k][1]
    dp[i+1][k][x>0] += dp[i][k][0]

print(sum(dp[len(n)][k]))
a,b,k=map(int,input().split())
i=1
list=[]

while a>i and b>i:
    if a%i==0 and b%i==0:
        list.append(i)
    i+=1

print(list[k-1])

### FIXED CODE ###

a,b,k=map(int,input().split())
i=1
list=[]

while a>=i and b>=i:
    if a%i==0 and b%i==0:
        list.append(i)
    i+=1

print(list[len(list)-k])
n, y = map(int, input().split(" "))

found = False

for i in range(0, n + 1):
    for j in range(0, n + 1 - i):
        sum = 10000 * i + 5000 * j + 1000 * (n - i - j)
        if sum == y:
            found = True
            print(str(i) + " " + str(j) + " " + str(n - i - j))

if !found:
    print("-1 -1 -1")


### FIXED CODE ###

n, y = map(int, input().split(" "))

found = False

for i in range(0, n + 1):
    for j in range(0, n + 1 - i):
        sum = 10000 * i + 5000 * j + 1000 * (n - i - j)
        if sum == y:
            found = True
            print(str(i) + " " + str(j) + " " + str(n - i - j))
            break
    if found:
        break

if found is False:
    print("-1 -1 -1")
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
num = min(a, b, c, d, e)
cnt = n // nu if n % num == 0 else n // num + 1
print(cnt + 4)

### FIXED CODE ###

n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
num = min(a, b, c, d, e)
cnt = n // num if n % num == 0 else n // num + 1
print(cnt + 4)
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n,m,q = list(map(int, input().split()))
s = [None]*n
for i in range(n):
    s[i] = list(map(int, input()))
e1 = [[0]*(m) for _ in range(n-1)]
e2 = [[0]*(m-1) for _ in range(n)]
for i in range(n):
    for j in range(m):
        if i<n-1 and s[i][j]==s[i+1][j]==1:
            e1[i][j] = 1
        if j<m-1 and s[i][j]==s[i][j+1]==1:
            e2[i][j] = 1
def cumsum(a):
    """l[i] = sum(a[:i]) なるlを返す
    sum(a[i:j]) == l[j+1] - l[i]
    """
    c = 0
    l = [None] * (len(a)+1)
    for i,num in enumerate(a):
        l[i] = c
        c += num
    l[-1] = c
    return l

def cumsum2(v):
    # v: h*wの2次元リスト
    h,w = len(v), len(v[0])
    ans = [[0]*(w+1) for _ in range(h+1)]
    val = [cumsum(vv) for vv in v]
    for y in range(w+1):
        tmp = cumsum([val[i][y] for i in range(h)])
        for x in range(h+1):
            ans[x][y] = tmp[x]
    return ans
c0 = cumsum2(s)
c1 = cumsum2(e1)
c2 = cumsum2(e2)
ans = [None]*q
for i in range(q):
    x1,y1,x2,y2 = map(lambda x: int(x)-1, input().split())
    val = c0[x2+1][y2+1] - c0[x1][y2+1] - c0[x2+1][y1] + c0[x1][y1]
    val2 = c1[x2][y2+1] - c1[x2][y1] - c1[x1][y2+1] + c1[x1][y1]
    val3 = c2[x2+1][y2] - c2[x2+1][y1] - c2[x1][y2] + c2[x1][y1]
    ans[i] = val - (val2+val3)
write("\n".join(map(str, ans)))

### FIXED CODE ###

import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n,m,q = list(map(int, input().split()))
s = [None]*n
for i in range(n):
    s[i] = list(map(int, input()))
e1 = [[0]*(m) for _ in range(n-1)]
e2 = [[0]*(m-1) for _ in range(n)]
for i in range(n):
    for j in range(m):
        if i<n-1 and s[i][j]==s[i+1][j]==1:
            e1[i][j] = 1
        if j<m-1 and s[i][j]==s[i][j+1]==1:
            e2[i][j] = 1
def cumsum2(v):
    # v: h*wの2次元リスト
    h,w = len(v), len(v[0])
    v.insert(0, [0]*w)
    for l in v:
        l.insert(0, 0)
    for i in range(1,h+1):
        for j in range(1,w+1):
            v[i][j] = v[i-1][j] + v[i][j-1] - v[i-1][j-1] + v[i][j]
    return v
s = cumsum2(s)
if e1:
    e1 = cumsum2(e1)
if e2:
    e2 = cumsum2(e2)
ans = [None]*q
for i in range(q):
    x1,y1,x2,y2 = map(lambda x: int(x)-1, input().split())
    val = s[x2+1][y2+1] - s[x1][y2+1] - s[x2+1][y1] + s[x1][y1]
    if e1:
        val2 = e1[x2][y2+1] - e1[x2][y1] - e1[x1][y2+1] + e1[x1][y1]
    else:
        val2 = 0
    if e2:
        val3 = e2[x2+1][y2] - e2[x2+1][y1] - e2[x1][y2] + e2[x1][y1]
    else:
        val3 = 0
    ans[i] = val - (val2+val3)
write("\n".join(map(str, ans)))
N=int(inout())
S=list(input() for i in range(N))
print(len(set(S)))


### FIXED CODE ###

N = int(input())
List = list(input() for i in range(N))
print(len(set(List)))
sum = 0
n = int(input())
l = [list(map(int, input().split()) for i in range(3))]

for i in range(n-1):
  sum = sum + l[1][i]
  if l[0][i+1] - l[0][i] == 1:
    sum = sum + l[2][i]
sum = sum + l[1][n]
print(sum)

### FIXED CODE ###

sum = 0
n = int(input())
l = [list(map(int, input().split())) for i in range(3)]

for i in range(n-1):
  sum = sum + l[1][i]
  if l[0][i+1] - l[0][i] == 1:
    sum = sum + l[2][l[0][i]-1]
sum = sum + l[1][n-1]
print(sum)
''' ===========================================
from collections import deque
    appendleft() = push_front(), append = push_back()
    popfleft() = pop_front(), pop() = pop_back()
import heapq #heappush(trgt, val) heappop(trgt) trgt[0] __lt__<
=========================================== '''
##======================================python3
import sys
import collections
from sys import stdin #read(), readline()
input = stdin.readline
sys.setrecursionlimit(10**6)
INF = 1<<50
MINI = 100005

class gv:
    input:str = None;
    
def build():
    gv.str = input()

def solve():
    slen = len(gv.str)
    if (slen&1) == 1:
        print("No")
        return
    
    for i in (0,slen,2):
        if (gv.str[i:i+1] == "hi") :
            pass
        else :
            print("No")
            return
    
    print("Yes")
    
    

if __name__ == '__main__':
    build()
    solve()


### FIXED CODE ###

class gv:
    input = None;
    
def build():
    gv.str = input()

def solve():
    slen = len(gv.str)
    if (slen&1) == 1:
        print("No")
        return
    
    for i in range(0,slen,2):
        if (gv.str[i:i+2] == "hi") :
            pass
        else :
            print("No")
            return
    
    print("Yes")
    
    

build()
solve()