#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 10;
long long x[maxn], p[maxn], a[maxn], ans[maxn];
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int main() {
  cin.tie(0);
  cout.tie(0);
  long long n, m, k = 0;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (i) x[i - 1] = a[i] - a[i - 1];
  }
  long long ans;
  for (int i = 0; i < n - 1; i++) {
    if (i == 0)
      ans = x[i];
    else {
      ans = gcd(ans, x[i]);
    }
  }
  int flag = 0;
  for (int i = 1; i <= m; i++) {
    cin >> p[i];
    if (ans % p[i] == 0) {
      flag = i;
    }
  }
  if (flag)
    cout << "YES" << endl << a[0] << " " << flag << endl;
  else
    cout << "NO" << endl;
  return 0;
}
