#include <bits/stdc++.h>
using namespace std;
long long x[300001], p[300001], jj[300000];
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  if (a > b)
    gcd(a % b, b);
  else
    gcd(b % a, a);
}
int main(void) {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) {
    scanf("%lld", &x[i]);
    jj[i] = x[i] - x[i - 1];
  }
  for (int i = 1; i <= m; ++i) {
    scanf("%lld", &p[i]);
  }
  long long gxs = jj[2];
  for (int i = 3; i <= n; ++i) {
    gxs = gcd(gxs, jj[i]);
    if (gxs == 1) break;
  }
  bool f = 0;
  for (int i = 1; i <= m; ++i) {
    if (gxs % p[i] == 0) {
      cout << "YES" << endl;
      cout << x[1] << " " << i << endl;
      f = 1;
      break;
    }
  }
  if (f == 0) {
    cout << "NO" << endl;
  }
  return 0;
}
