#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
const long long mod = 1e9 + 7;
const long long inf = 1e18;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long powm(long long base, long long exp) {
  long long ans = 1;
  while (exp) {
    if (exp & 1) ans = (ans * base) % mod;
    exp >>= 1, base = (base * base) % mod;
  }
  return ans;
}
long long add(long long a, long long b) { return (a % mod + b % mod) % mod; }
long long sub(long long a, long long b) {
  return (a % mod + mod - b % mod) % mod;
}
long long mult(long long a, long long b) {
  return ((a % mod) * (b % mod)) % mod;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  long long x[n], p[m];
  for (long long i = 0; i < n; i++) cin >> x[i];
  for (long long i = 0; i < m; i++) cin >> p[i];
  long long g = 0;
  for (long long i = 1; i < n; i++) g = gcd(g, x[i] - x[i - 1]);
  for (long long i = 0; i < m; i++) {
    if (g % p[i] == 0) {
      cout << "YES" << endl << x[0] << " " << i + 1;
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
