#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int main() {
  long long n, m, t, p = 0, k, x, y, flag = 0, q = 0, l = 0, r = 0, z = 0,
                     sum = 0, i, j, k1, k2, k3, k4;
  cin >> n >> m;
  long long a[n], b[m], c[n - 1];
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (i = 0; i < m; i++) {
    cin >> b[i];
  }
  for (i = 0; i < n - 1; i++) {
    c[p] = a[i + 1] - a[i];
    p++;
  }
  t = c[0];
  for (i = 1; i < p; i++) {
    t = gcd(t, c[i]);
  }
  for (i = 0; i < m; i++) {
    if (t % b[i] == 0) {
      k = i + 1;
      flag = 1;
      break;
    }
  }
  if (flag == 1) {
    cout << "YES" << endl;
    cout << a[0] << " " << k;
  } else
    cout << "NO";
  return 0;
}
