import sys,math,io,os,time,itertools,collections
mod=10**9+7
from collections import deque
sys.setrecursionlimit(10000)
i=sys.stdin.readline
pr=sys.stdout.write
#use sys.stdout.write() (remember to convert to str b4 and concatenate "\n")
global start,end

def main():
    n,m=[int(k) for k in i().split()]
    x=[int(k) for k in i().split()]
    p=[int(k) for k in i().split()]
    y=x[0]
    gc=x[1]-x[0]
    for k in range(2,n):
        gc=math.gcd(gc,x[k]-x[k-1])
    for k in range(m):
        if gc%p[k]==0:
            pr("YES\n")
            pr(str(y)+" "+str(k+1)+"\n")
            break
    else:
        pr("NO\n")

t=1
#t=int(i())
start=time.perf_counter()
for _ in range(t):
    main()
end=time.perf_counter()
#print(end-start)
import sys,math,io,os,time,itertools,collections
mod=10**9+7
from collections import deque
sys.setrecursionlimit(10000)
i=sys.stdin.readline
pr=sys.stdout.write
#use sys.stdout.write() (remember to convert to str b4 and concatenate "\n")
global start,end

def main():
    n,m=[int(k) for k in i().split()]
    x=[int(k) for k in i().split()]
    p=[int(k) for k in i().split()]
    y=x[0]
    gc=x[1]-x[0]
    for k in range(2,n):
        gc=math.gcd(gc,x[k]-x[k-1])
    for k in range(m):
        if gc%p[k]==0:
            pr("YES\n")
            pr(str(y)+" "+str(k+1)+"\n")
            break
    else:
        pr("NO\n")

t=1
#t=int(i())
start=time.perf_counter()
for _ in range(t):
    main()
end=time.perf_counter()
#print(end-start)
#use sys.stdout.write() (remember to convert to str b4 and concatenate "\n") #t=int(i()) #print(end-start)