#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5, mod = (int)1e9 + 7;
int n, m;
long long a[N] = {};
long long GCD(long long n1, long long n2) {
  if (n2 != 0)
    return GCD(n2, n1 % n2);
  else
    return n1;
}
int main() {
  ios::sync_with_stdio(0), ios_base::sync_with_stdio(0), cin.tie(0),
      cout.tie(0);
  ;
  cin >> n >> m;
  long long gcd = 0, ans = -1;
  for (int i = 1; i <= (int)n; ++i) {
    cin >> a[i];
    if (i >= 2) gcd = GCD(gcd, (a[i] - a[i - 1]));
  }
  int idx = 0;
  for (int i = 1; i <= (int)m; ++i) {
    long long x;
    cin >> x;
    if (x % gcd == 0 || gcd % x == 0) {
      if (ans > x || ans == -1) {
        ans = x;
        idx = i;
      }
    }
  }
  if (ans == -1)
    return cout << "NO"
                << "\n",
           0;
  for (int i = 2; i <= (int)n; ++i) {
    if ((a[i] - a[i - 1]) % ans != 0)
      return cout << "NO"
                  << "\n",
             0;
  }
  cout << "YES\n";
  cout << a[1] << " " << idx << "\n";
  return 0;
}
