import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.string;


void main() {
    auto s = readln.split.map!(to!int);
    auto N = s[0];
    auto M = s[1];
    auto A = readln.split.map!(to!long).array;
    auto P = readln.split.map!(to!long).array;
    
    auto B = (N-1).iota.map!(i => A[i+1] - A[i]).array;
    auto G = B.reduce!((a, b) => gcd(a, b));
    
    foreach (i; 0..M) {
        if (G % P[i] == 0) {
            writeln("YES");
            writeln(A.front, " ", i + 1);
            return;
        }
    }

    writeln("NO");
}