#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T gcd(T a, T b) {
  while (b != 0) swap(b, a %= b);
  return a;
}
long long dx[] = {1, 0, -1, 0};
long long dy[] = {0, 1, 0, -1};
template <typename T>
T power(T m, long long n) {
  T r = 1;
  while (n > 0) {
    if (n & 1) {
      r = (long long)r * m;
    }
    m = (long long)m * m;
    n = n >> 1;
  }
  return r;
}
void solve() {
  long long n, m;
  cin >> n >> m;
  vector<long long> x(n), p(m);
  long long cd = 0;
  for (long long i = 0; i < n; i++) {
    cin >> x[i];
  }
  for (long long i = 1; i < n; i++) {
    cd = gcd(cd, x[i] - x[i - 1]);
  }
  for (long long i = 0; i < m; i++) {
    cin >> p[i];
  }
  for (long long i = 0; i < m; i++) {
    if (cd % p[i] == 0) {
      cout << "YES" << '\n';
      cout << x[0] << " " << i + 1 << '\n';
      return;
    }
  }
  cout << "NO" << '\n';
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cerr.tie(nullptr);
  long long t = 1;
  for (long long tt = 0; tt < t; tt++) {
    solve();
  }
}
