Harryxun/stf_run huggingface dataset:
N,M=map(int, input().split())
A=[input() for _ in range(N)]
B=[input() for _ in range(M)]

for i in range(N):
    if B[0] in A[i]:
        if all(B[j] in A[i+j] for j in range(1,M)):
            print('Yes')
            exit(0)
print('No')


### FIXED CODE ###

N,M=map(int, input().split())
A=[input() for _ in range(N)]
B=[input() for _ in range(M)]

for i in range(N-M+1):
    for j in range(N-M+1):
        t=[k[j:j+M] for k in A[i:i+M]]
        if t==B:
            print('Yes')
            exit()
print('No')
N = input()
f = N % 10 
if (f==3):
  print("bon")
elif (f==0 || f==1 || f== 6 || f==8):
  print("pon")
else:
  print("hon")

### FIXED CODE ###

N=int(input())
f = N % 10
if f==3:
  print("bon")
elif f==0 or f==1 or f==6 or f==8:
  print("pon")
else:
  print("hon")
import math
from functools import reduce
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(numbers):
    return reduce(lcm_base, numbers, 1)

n=int(input())
t=[int(input()) for i in range(n)]
print(lcm(t))

### FIXED CODE ###

import fractions
n=int(input())
t=[int(input()) for i in range(n)]
ans=t[0]
for i in range(1,n):
    ans=ans*t[i]//fractions.gcd(ans,t[i])
print(ans)
S = input()[::-1]

dp = [[1]]
MOD = 10**9+7

for i in range(1,len(S)+1):
  s = S[i-1]
  dp += [[0]*13]
  if s=='?':
    for j in range(13):
      for h in range(10):
        x = h*(10**(i-1))%13
        dp[i][(j+x)%13] += dp[i-1][j]
    for j in range(13):
      dp[i][j] = dp[i][j]%MOD
  else:
    c = int(s)
    x = c*(10**(i-1))%13
    for j in range(13):
      dp[i][(j+x)%13] = dp[i-1][j]
    for j in range(13):
      dp[i][j] = dp[i][j]%13
print(dp[-1][5])

### FIXED CODE ###

S = input()
con = 10**9 + 7

T = [s if s != "?" else "0" for s in S]
T = int(''.join(T))
SS = T % 13

def get_mod(S):
    c = {}
    iii = 1
    for i in range(len(S)):
        if S[len(S) - i - 1] != "?":
            iii *= 10
            iii %= 13
            continue
        c[i] = {(j * iii) % 13: 1 for j in range(0, 10)}
        iii *= 10
        iii %= 13
    return c
c = get_mod(S)

def get_tdp(pdp):
    tdp = {i: 0 for i in range(13)}
    for r in v.keys():
        for _r, _v in pdp.items():
            i = (_r + r) % 13
            tdp[i] += _v
    for i in range(13):
        tdp[i] %= con
    return tdp

pdp = {i: 0 for i in range(13)}
pdp[SS] += 1
for k, v in c.items():
    pdp = get_tdp(pdp)

ans = pdp[5]
print(ans)
N=int(input())
S=list(map(int,input().split( )))
S = sorted(S)
tri_num=0
for i in range(N-2):
    k=i+2
    for j in range(i+1,N-1):
        while k < N:
            if S[i] + S[j] <= S[k]:
                tri_sum = tri_sum + k-j-1
                k+=1
                break
            else:
                k+=1
print(tri_num)


### FIXED CODE ###

N=int(input())
S=list(map(int,input().split( )))
S = sorted(S)
tri_num=0
for i in range(N-2):
    k = i+2
    for j in range(i+1,N-1):
        while k < N:
            if S[i] + S[j] <= S[k]:
                tri_num = tri_num + k-j-1
                if k == i+2:
                    k+=1
                break
            if k == N-1:
                tri_num = tri_num + k-j
                break
            k+=1
print(tri_num)
a=int(input())
b=int(input())
c=int(input())
d=int(input())
print(max(a*c,a*d,b*c,b*d))

### FIXED CODE ###

abcd=input().split()
a=int(abcd[0])
b=int(abcd[1])
c=int(abcd[2])
d=int(abcd[3])
print(max(a*c,a*d,b*c,b*d))
N, M = [int(x) for x in input().split()]

A = [int(x) for x in input().split()]
A.sort(reverse=True)

C = []
for _ in range(M):
  b, c = [int(x) for x in input().split()]
  C.extend([c]*b)
C.sort(reverse=True)

total = 0
for _ in range(N):
  if A[0] > C[0]:
    a = A.pop(0)
    total += a
  else:
    c = C.pop(0)
    total += c

print(total)

### FIXED CODE ###

N, M = [int(x) for x in input().split()]

A = [int(x) for x in input().split()]
A.sort(reverse=True)

S = []
for _ in range(M):
  b, c = [int(x) for x in input().split()]
  S.append((c, b))

S.sort(reverse=True)

total = 0
count = 0

while count < N and len(S) > 0:
  if A[0] > S[0][0]:
    a = A.pop(0)
    total += a
    count += 1
  else:
    c = S.pop(0)
    if c[1] < N - count:
      total += c[0] * c[1]
      count += c[1]
    else:
      total += c[0] * (N - count)
      count = N
if len(S) == 0:
  total += sum(A[:N-count])
print(total)
N = int(input())
K = int(input())
x = list(map(int,input().split()))
length = 0
Khalf = K//2
for i in range(N):
	if x[i] <= Khalf:
		length += 2*x[i]
	else:
		length += 2*(K-x[i])
print(length)


### FIXED CODE ###

N = int(input())
A = int(input())
print(N**2-A)
a,b = map(int,input().split())

if a > b:
op = '>'
elif a < b:
op = '=='

print("a %s b"%op)



### FIXED CODE ###

a,b = map(int, input().split())
if a<b:
	print("a < b")
elif a==b:
	print("a == b")
else:
	print("a > b")
A, B, C = main(int, input().split())
 
if (C >= A and C <= B):
  print("Yes")
  
else:
  print("No")

### FIXED CODE ###

A, B, C = map(int, input().split())
 
if (C >= A and C <= B):
  print("Yes")
  
else:
  print("No")
x, n = map(int, input().split())
P = list(map(int, input().split()))

for d in range(x + 1):
    for s in [-1, +1]:
        a = x + s * d
        if p.count(a) == 0:
            print(a)
            exit(0) 

### FIXED CODE ###

x, n = map(int, input().split())
P = list(map(int, input().split()))

for d in range(x + 1):
    for s in [-1, +1]:
        a = x + s * d
        if P.count(a) == 0:
            print(a)
            exit(0)
n=int(input())
a=n//1000
b=(n//100)%10
c=(n//10)%10
d=n%10
 
if a==b:
  print(Bad)
elif b==c:
  print(Bad)
elif c==d:
  print(Bad)
else:
  print(Good)

### FIXED CODE ###

n=int(input())
a=n//1000
b=(n//100)%10
c=(n//10)%10
d=n%10
 
if a==b:
  print('Bad')
elif b==c:
  print('Bad')
elif c==d:
  print('Bad')
else:
  print('Good')
a, b, c = map(int, input().split())
ans = [False]*100
ans[a] |= True
ans[b] |= True
ans[c] |= True

print(sum(ans))


### FIXED CODE ###

print(len(set(map(int, input().split()))))
N=int(input())
List=list(map(int,input().split()))

counter=0
for i in range(N):
  Pj_list=[]
  for j in range(i):
    Pj=List[j]
    Pj_list.append(Pj)
  Mi=min(Pj_list)
  if Mi==List[i]:
    counter+=1

print(counter)

### FIXED CODE ###

N=int(input())
List=list(map(int,input().split()))

counter=0
mj=N
for i in range(N):
  if mj>List[i]:
    mj=List[i]
  if List[i]==mj:
    counter+=1
print(counter)
A = input()
B = input()
C = input()
if A < B:
    D = B
    E = A
else :
    E = B
    D = A

if D > C > E :
    print("Yes")
else :
    print("No")

### FIXED CODE ###

A,B,C = map(int,input().split())
if A > C > B :
    print("Yes")
elif B > C > A :
    print("Yes")
else :
    print("No")
import sys

n, m = map(int, input().rstrip().split())
dist = [[500000 for i in range(n)]for j in range(n)]

for i in range(n):
    for j in range(n):
        if (i==j):
            dist[i][j]=0

a = []
b = []
c = []

for i in range(m):
    x, y, z = map(int, input().rstrip().split())
    dist[x-1][y-1] =  min(dist[x-1][y-1], z)
    dist[y-1][x-1] =  min(dist[x-1][y-1], z)
    a.append(x-1)
    b.append(y-1)
    c.append(z)
    
for k in range(n):
    for i in range(n):
        for j in range(n):
            dist[i][j]=min(dist[i][j],dist[i][k]+dist[k][j])

result = m

for i in range(m):
    for j in range(m):
        if dist[j][a[i]] + c[i] == dist[j][b[i]]:
            result -= 1
            break

print(result)

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000001)

n, m = map(int, input().rstrip().split())
dist = [[500000 for i in range(n)]for j in range(n)]

for i in range(n):
    for j in range(n):
        if (i==j):
            dist[i][j]=0

a = []
b = []
c = []

for i in range(m):
    x, y, z = map(int, input().rstrip().split())
    dist[x-1][y-1] =  min(dist[x-1][y-1], z)
    dist[y-1][x-1] =  min(dist[x-1][y-1], z)
    a.append(x-1)
    b.append(y-1)
    c.append(z)
    
for k in range(n):
    for i in range(n):
        for j in range(n):
            dist[i][j]=min(dist[i][j],dist[i][k]+dist[k][j])
#print(dist)
result = m

for i in range(m):
    for j in range(n):
        if dist[j][a[i]] + c[i] == dist[j][b[i]]:
            result -= 1
            break

print(result)
import sys
#from collections import deque
input = sys.stdin.buffer.readline

x, y, a, b, c = map(int, input().split())
p = sorted(list(map(int,input().split())),reverse=True)
q = sorted(list(map(int,input().split())),reverse=True)
r = sorted(list(map(int,input().split())),reverse=True)
ans = p[:x]
ans[x:x] = q[:y]
ans=sorted(ans,reverse=True)
i = 0
result = 0
for A in ans:
    if A < r[i]:
        result += r[i]
        i += 1
        continue
    result += A
print(result)

### FIXED CODE ###

import sys
#from collections import deque
input = sys.stdin.buffer.readline

x, y, a, b, c = map(int, input().split())
p = sorted(list(map(int,input().split())),reverse=True)
q = sorted(list(map(int,input().split())),reverse=True)
r = sorted(list(map(int,input().split())),reverse=True)
ans = p[:x]
ans[x:x] = q[:y]
ans += r
ans = sorted(ans,reverse=True)
print(sum(ans[:x+y]))
n, a, b, c, d = (map(int, input().split()))
S = input()
import re
if '##' in S:
  return 'No'
elif d>c and not '...' in S:
  return 'No'
elif c==d:
  return 'No'
else:
  return 'Yes'

### FIXED CODE ###

n, a, b, c, d = (map(int, input().split()))
S = input()
if '##' in S[a-1:c] or '##' in S[b-1:d] :
	print('No')
elif d < c and not '...' in S[b-2:d+1]:
        print('No')
else:
    print('Yes')
#AtCorder
def main():
	a,b=map(int, input().split())
	for i in range(a)
	if a*10**b <=b*10**a:
		print(str(a)*b)
	else:
		print(str(b)*a)
main()

### FIXED CODE ###

#AtCorder
def main():
	a,b=map(int, input().split())
	if a <=b:
		print(str(a)*b)
	else:
		print(str(b)*a)
main()
from collections import deque

d=[(1,0),(0,1),(-1,0),(0,-1)]
H,W=map(int,input().split())
M = []
Max_list = []
for i  in range(H):
    t = input()
    M.append(t)
dist = [[-1]*W for _ in range(H)]
def BFS(i,j):
    q = deque()
    dist = [[-1]*W for _ in range(H)]
    if M[i][j] == '.':

        #前処理
        Ma = 0
        q.append((i, j))#スタート地点挿入
        dist[i][j] = 0
        while q:
            cx,cy = q.popleft()
            for nx,ny in d:
                x ,y= cx+nx,cy+ny
                if 0<= x < H and 0<= y < W and M[x][y] == "." and dist[x][y]==-1:
                    dist[x][y]=dist[cx][cy]+1
                    Ma = max(Ma,dist[x][y])
                    q.append((x,y))
        return Ma
for i in range(H):#全部の地点でBFSをためす
    for j in range(W):
        Max_list.append(BFS)

print(max(Max_list))

### FIXED CODE ###

from collections import deque
 
INF = float('inf')
MOD = 10 ** 9 + 7
dy = (0, -1, 0, 1)
dx = (1, 0, -1, 0)


H,W=map(int,input().split())
M = []
Max_list = []
for i  in range(H):
    t = input()
    M.append(t)
dx = [0,0,-1,1]
dy = [1,-1,0,0]
dist = [[-1]*W for _ in range(H)]
q = deque()
for i in range(H):
    for j in range(W):
        dist = [[-1]*W for _ in range(H)]
        if M[i][j] == '.':
            Ma = 0
            q.append((i, j))
            dist[i][j] = 0
            while q:
                cx,cy = q.popleft()
                for nx,ny in zip(dx,dy):
                    x ,y= cx+nx,cy+ny
                    if x<0 or y<0 or x>=H or y>=W or dist[x][y]>0:
                        continue
                    if M[x][y] == "." and dist[x][y] == -1:
                        dist[x][y]=dist[cx][cy]+1
                        Ma = max(Ma,dist[x][y])
                        q.append((x,y))
            # print(Ma)
            Max_list.append(Ma)
# print(Max_list)

print(max(Max_list))
from math import gcd
k=map(int,input())
r=range(1,k+1)
ans=0
for i in r:
  for j in r:
    for k in r:
      ans+=gcd(k,gcd(i,j))
print(ans)
# 間に合うはずなくない？？

### FIXED CODE ###

# coding: utf-8
# Your code here!

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

n=int(input())

import math
from collections import Counter

# def gcd(*numbers):
    # return reduce(math.gcd, numbers)

ans=0
t=[]
for i in range(1,n+1):
    for j in range(1,n+1):
        t.append(math.gcd(i,j))
        
c=Counter(t).items()

for (i,j) in c:
    for k in range(1,n+1):
        ans+=math.gcd(i,k)*j
        # p\rint(c)
print(ans)
import random

s = input()

len_s = len(s)

num = random.randint(0,len_s-4)

name = s[num]+s[num+1]+s[num+2]

print(name)

### FIXED CODE ###

import random

s = input()

len_s = len(s)

if len_s==3:
	num = 0
else:
	num = random.randint(0,len_s-4)

name = s[num]+s[num+1]+s[num+2]

print(name)
a = int(input())
b = int(input())
c = int(input())

if a + b + c == 17:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

s = input().split(" ")
if s.count('5') == 2 and s.count('7') == 1:
	print("YES")
else:
	print("NO")
n,m = map(int, input().strip().sprit(' '))

homework = list(map(int, input().strip().sprit(' ')))

day = n - sum(homework)

if day >= 0:
  print(day)
else:
  print(-1)

  

### FIXED CODE ###

n,m = map(int, input().strip().split(" "))
 
homework = list(map(int, input().strip().split(" ")))
 
day = n - sum(homework)
 
if day >= 0:
    print(day)
else:
    print(-1)
x = int(input())
n = 10*7

def blp(dp,num):
    l = 0
    r = len(dp)-1
    while l <= r:
        mid = (l+r)//2
        if num == dp[mid]:return mid
        elif num >= dp[mid]:l = mid+1
        else:r = mid-1
    return 0

def bln(dp,num):
    l = 0
    r = -len(dp)-1
    while l>=r:
        mid = (l+r)//2
        if num == dp[mid]:return mid
        elif num >= dp[mid]:r = mid+1
        else:l = mid-1
    return 0
            
ap = [i**5 for i in range(n)]
an = [-(i**5) for i in range(n)]

for b in range(-n,n):
    num = x + b**5
    a = max(blp(ap,num),bln(an,num))
    if a:print(a,b) ; break

### FIXED CODE ###

x = int(input())
n = 100000
 
def binp(arr, val):
    left,right = 0,len(arr)-1
    while left <= right:
        mid = (left+right)//2
        if val==arr[mid]: return mid
        elif val>=arr[mid]: left = mid+1
        else: right = mid-1
    return 0
 
def binn(arr, val):
    left,right = 0,len(arr)-1
    while left >= right:
        mid = (left+right)//2
        if val==arr[mid]: return mid
        elif val>=arr[mid]: right = mid+1
        else: left = mid-1
    return 0
 
ap = [i**5 for i in range(n)]
an = [-(i**5) for i in range(n)]
 
for b in range(-n,n):
    val = x + b**5
    a = max(binp(ap, val), binn(an,val))
    if a: print(a,b) ; break
n = int(input())
a = list(map(int, input().split()))
c = 0
for i in range(n):
  if a[i] != i + 1:
    c+=1
    
if c == 0 or c == 2:
  print('YES')
  
else:
  print('NO')


### FIXED CODE ###

a,b = input().split()
a =int(a)
b = int(b)

if (a + b) % 2 ==0:
  print((a+b)//2)
else:
  print('IMPOSSIBLE')
S = input()
S = S[::-1]
l = ['dream','dreamer','erase','eraser']
L = []
for i in l:
    L.append(i[::-1])
def rec(s):
    flag=False
    for ii in L:
        leng = len(ii)
        if len(s)<leng:
            continue
        else:
            if s[num:leng]==ii:
                if len(s)==leng:
                    flag=True
                    break
                else:
                    return rec(s[leng:])
            else:
                continue
    return flag
f = rec(S)
if f:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

S = input()
S = S[::-1]
l = ['dream','dreamer','erase','eraser']
L = []
pos = 0
f=True

for i in l:
    L.append(i[::-1])

while pos < len(S):
    no_match = True
    for candidate in L:
        if S[pos:pos+len(candidate)]==candidate:
            pos+=len(candidate)
            no_match =False
            break
    if no_match:
        f =False
        break


if f:
    print('YES')
else:
    print('NO')
from collections import deque

mod = 10**9+7
def I(): return int(input())
def LI(): return list(map(int,input().split()))
def MI(): return map(int,input().split())
def LLI(n): return [list(map(int, input().split())) for _ in range(n)]

N,M = MI()
links = [[] for _ in range(N)]

for _ in range(M):
    a, b = MI()
    a -= 1
    b -= 1
    links[a].append(b)
    links[b].append(a)

ans = [-1] * N
ans[0] = 0
q = deque([(0, 0)])
while q:
  print(ans)
  room, prev = q.popleft()
  for next_ in links[room]:
    if ans[next_] < 0:
      ans[next_] = room
      q.append((next_, room))
for i in range(1,N):
  print(ans[i]+1)

### FIXED CODE ###

from collections import deque

mod = 10**9+7
def I(): return int(input())
def LI(): return list(map(int,input().split()))
def MI(): return map(int,input().split())
def LLI(n): return [list(map(int, input().split())) for _ in range(n)]

N,M = MI()
links = [[] for _ in range(N)]

for _ in range(M):
    a, b = MI()
    a -= 1
    b -= 1
    links[a].append(b)
    links[b].append(a)

ans = [-1] * N
ans[0] = 0
q = deque([(0, 0)])
while q:
  room, prev = q.popleft()
  for next_ in links[room]:
    if ans[next_] < 0:
      ans[next_] = room+1
      q.append((next_, room))
print("Yes")
for i in range(1,N):
  print(ans[i])
a,b=map(int,input().split())
print a*b,a*2+b*2

### FIXED CODE ###

a,b=map(int,raw_input().split())
print a*b,a*2+b*2
N, M, C = map(int, input().split())
 
B = list(input().split())
 
ans = []
 
src = []
 
for i in range(N):
  src.append(list(map(int, input().split())))
  
  for n in range(M):
    d = src[i][n]*B[n] + C
    if (d > 0):
      ans.append(1)
 
print(ans.count(1))

### FIXED CODE ###

N, M, C = map(int, input().split())
 
B = list(map(int, input().split()))
 
ans = 0
 
src = []

for i in range(N):
  src.append(list(map(int, input().split()))) 
  
for i in range(N):
  d = C
  for n in range(M):
    d += src[i][n]*B[n]
  if (d > 0):
    ans+= 1

print(ans)
N = int(input())
S = str(input())
T = str(input())
f = ''
for i in range(N):
    f += S[i]
    f += T[i]
print(f)

### FIXED CODE ###

N = int(input())
S,T=map(str, input().split())
f = ''
for i in range(N):
    f += S[i]
    f += T[i]
print(f)
# -*- coding: utf-8 -*-

N = int(input())
A = [[0] * 3 for i in range(N)]
for a in A:
    a[0], a[1], a[2] = list(map(int, input().split()))


def calc(A):
    for x in range(101):
        for y in range(101):
            h_spots = [0] * N
            for i, a in enumerate(A):
                h_spots[i] = a[2] + abs(x - a[0]) + abs(y - a[1])

            if min(h_spots) == max(h_spots):
                return x, y, h_spots[0]


print(*calc(A))

### FIXED CODE ###

# -*- coding: utf-8 -*-

n = int(input())
li = [list(map(int, input().split())) for i in range(n)]
li.sort(key=lambda x: x[2])
a, b, c = li[-1]
for x in range(101):
    for y in range(101):
        h = abs(x-a) + abs(y-b) + c
        if all(k == max(h-abs(x-i)-abs(y-j), 0) for i, j, k in li):
            print(x, y, h)
            exit()
N = input()

A = raw_input().split(' ')

total = 0
B = [0]
dic = {}

for i in range(N):
    total += int(A[i])
    B.append(total)

for b in B:
    if b in dic:
        dic[b] +=1
    else:
        dic[b] = 1
def C(n):
    return int(n*(n-1)/2)

ans = 0;

for k,v in dic.items():
    ans += C(v)

print(ans)


### FIXED CODE ###

N = int(input())

A = input().split(' ')

total = 0
B = [0]
dic = {}

for i in range(N):
    total += int(A[i])
    B.append(total)

for b in B:
    if b in dic:
        dic[b] +=1
    else:
        dic[b] = 1
def C(n):
    return int(n*(n-1)/2)

ans = 0;

for k,v in dic.items():
    ans += C(v)

print(ans)
h,w=map(int,input().split())
for i in range(h):
    for j in range(w):
        a=list(input())

print('#'*(w+2))
for i in range(h):
    for j in range(w):      
        print('#'+a[i][j]+'#')
print('#'*(w+2))

### FIXED CODE ###

h,w=map(int,input().split())
print('#'*(w+2))
for i in range(h):    
    print('#'+input()+'#')
print('#'*(w+2))
N = int(input())
al = list(map(int,input().split()))
ansal = sorted(al)

for i in range(N):
    for j in range(i,N):
        cond_al = al.copy()
        cond_al[i],cond_al[j] = cond_al[j],cond_al[i]
        if(cond_al==ansal):
            print("YES")
            exit(1)

print("NO")


### FIXED CODE ###

N = int(input())
al = list(map(int,input().split()))
ansal = sorted(al)

for i in range(N):
    for j in range(i,N):
        cond_al = al.copy()
        cond_al[i],cond_al[j] = cond_al[j],cond_al[i]
        if(cond_al==ansal):
            print("YES")
            exit(0)

print("NO")
N, M, C = map(int, input().split)
Blis = [int(x) for x in input().split()]
k = 0
for i in range(N):
  Alis = [int(x) for x in input().split()]
  total = 0
  for j in range(M):
    total = total + (Alis[j])*(Blis[j])
  total = total + C
  if total > 0:
    k = k + 1
print(k)    

### FIXED CODE ###

N, M, C = map(int, input().split())
Blis = [int(x) for x in input().split()]
k = 0
for i in range(N):
  Alis = [int(x) for x in input().split()]
  total = 0
  for j in range(M):
    total = total + (Alis[j])*(Blis[j])
  total = total + C
  if total > 0:
    k = k + 1
print(k)
N, M = map(int, input().split())
G = [[] for i in range(N)]
for i in range(M):
  a, b = map(int, input().split())
  G[a - 1].append(b - 1)
  G[b - 1].append(a - 1)
V = []
for i, v in enumerate(G):
  if len(v) % 2:
    print('No')
    break
  if len(v) >= 6:
    print('Yes')
    break
  if len(v) == 4:
    V.append[i]
else:
  if len(V) != 2:
    print('Yes' if len(V) > 2 else 'No')
  else:
    s = V[0]
    for i in range(3):
      t = G[s].pop()
      while t not in V:
        t = G[t].pop()
      if s == t:
        print('Yes')
        break
      else:
        s = t
    else:
      print('No')

### FIXED CODE ###

N, M = map(int, input().split())
G = [[] for i in range(N)]
for i in range(M):
  a, b = map(int, input().split())
  G[a - 1].append(b - 1)
  G[b - 1].append(a - 1)
V = []
D = 0
for i in range(N):
  if len(G[i]) % 2:
    print('No')
    break
  D = max(len(G[i]), D)
  if len(G[i]) == 4:
    V.append(i)
else:
  if D >= 6:
    print('Yes')
  elif len(V) != 2:
    print('Yes' if len(V) > 2 else 'No')
  else:
    s = V[0]
    for i in range(3):
      t = G[s].pop()
      G[t].pop(G[t].index(s))
      while t not in V:
        d = G[t].pop()
        G[d].pop(G[d].index(t))
        t = d
      if s == t:
        print('Yes')
        break
      else:
        s = t
    else:
      print('No')
N=int(input())
print('ABC'+N)

### FIXED CODE ###

N=str(input())
print('ABC'+N)
# This program computes GCD and LCM
# -*- coding: utf-8
import sys


def gcd(a, b):
    while True:
        tmpb = b
        b = a % b
        a = tmpb
        if(b == 1):
            break
    return a


def lcm(a, b):
    for i in range(max([a, b]), a*b + 1):
        if(i % a == 0 and i % b == 0):
            return i
    return a*b


for i in sys.stdin:
    try:
        line = [int(k) for k in i.split(" ")]
        g = gcd(max(line), min(line))
        print(str(g) + " " + str(line[0]*line[1]/g))  # + str(lcm(line[0], line[1]))
    except:
        raise
        exit()

### FIXED CODE ###

# This program computes GCD and LCM
# -*- coding: utf-8
import sys


def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a


for i in sys.stdin:
    try:
        line = [int(k) for k in i.split(" ")]
        g = gcd(min(line), max(line))
        print(str(g) + " " + str(line[0]*line[1]//g))
    except:
        exit()
N = int(input())
L = [input() for _ in range(N)]

flg = False
if len(L) != len(set(L)): flg = True
for i in range(N):
  if flg: break
  if i != 0:
    if L[i][1] != L[i-1][-1]:
      flg = True
print ("No" if flg else "Yes")

### FIXED CODE ###

N = int(input())
L = [input() for _ in range(N)]

flg = False
if len(L) != len(set(L)): flg = True
for i in range(1, N):
  if flg: break
  if i != 0:
    if L[i][0] != L[i-1][-1]:
      flg = True
print ("No" if flg else "Yes")
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
B = abs(A-(T-0.006*H[0]))
for i in range(N):
    C = abs(A-(T-0.006*H[i]))
    if B>C:
        B = C
        ans = i+1
print(ans)


### FIXED CODE ###

N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
B = abs(A-(T-0.006*H[0]))
for i in range(N):
    C = abs(A-(T-0.006*H[i]))
    if B>=C:
        B = C
        ans = i+1
print(ans)