#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
long long gcd(long long x, long long y) { return y == 0 ? x : gcd(y, x % y); }
const long long INF = (long long)1e18 + 55;
int n, m;
long long x, y, z;
long long ans1 = INF;
int ans2;
int main() {
  scanf("%d%d", &n, &m);
  y = 0;
  scanf("%lld", &x);
  for (int i = 1; i < n; i++) {
    scanf("%lld", &z);
    y = gcd(y, abs(z - x));
  }
  x = (x - 1) % y + 1;
  ans2 = -1;
  for (int i = 0; i < m; i++) {
    scanf("%lld", &z);
    if (y % z) continue;
    z = (x - 1) % z + 1;
    if (z < ans1) {
      ans1 = z;
      ans2 = i + 1;
    }
  }
  if (ans2 == -1)
    printf("NO\n");
  else
    printf("YES\n%lld %d\n", ans1, ans2);
  return 0;
}
