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