#include <bits/stdc++.h>
using namespace std;
long long x[300005];
long long p[300005];
long long tmp[300005];
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int main() {
  int n, m;
  int ans;
  long long tmp;
  while (~scanf("%d%d", &n, &m)) {
    ans = -1;
    for (int i = 0; i < n; i++) scanf("%lld", &x[i]);
    tmp = x[0];
    for (int i = 0; i < m; i++) scanf("%lld", &p[i]);
    for (int i = 0; i < n - 1; i++) x[i] = x[i + 1] - x[i];
    for (int i = 1; i < n - 1; i++) x[i] = gcd(x[i], x[i - 1]);
    for (int i = 0; i < m; i++) {
      if (x[n - 2] % p[i] == 0) {
        ans = i + 1;
        break;
      }
    }
    if (ans != -1) {
      printf("YES\n");
      printf("%lld %d\n", tmp, ans);
    } else
      printf("NO\n");
  }
  return 0;
}
