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