#include <bits/stdc++.h>
using namespace std;
const int MAXN = 300005;
long long x[MAXN], p[MAXN];
int n, m;
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> x[i];
  for (int i = 1; i <= m; i++) cin >> p[i];
  long long d = x[2] - x[1];
  for (int i = 2; i < n; i++) d = gcd(d, x[i + 1] - x[i]);
  for (int i = 1; i <= m; i++) {
    if (d % p[i] == 0) {
      cout << "YES" << endl;
      cout << x[1] << " " << i << endl;
      exit(0);
    }
  }
  cout << "NO" << endl;
  return 0;
}
