#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 1;
long long n, i, j, k, m = 1e9 + 7;
unsigned long long dem = 0, tong = 0, x, y, z, l, r;
char k1, k2;
unsigned long long a[maxn], b[maxn], c[maxn], h[maxn], d[maxn];
char s[maxn], s1[maxn];
pair<long long, pair<long long, long long>> p[maxn];
unsigned long long dcg(unsigned long long a, unsigned long long b) {
  if (b == 0) return a;
  return dcg(b, a % b);
}
void enter() {
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (i = 2; i <= n; i++) {
    z = a[i] - a[i - 1];
    x = dcg(x, z);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  enter();
  for (i = 1; i <= m; i++) {
    cin >> b[i];
  }
  if (n == 1) {
    cout << "YES"
         << "\n";
    cout << a[1] << " " << 1;
    return 0;
  }
  bool kt = true;
  for (i = 1; i <= m; i++) {
    if (x % b[i] == 0) {
      y = i;
      kt = false;
      break;
    }
  }
  if (kt) {
    cout << "NO";
    return 0;
  } else {
    cout << "YES"
         << "\n";
    cout << a[1] << " " << y;
    return 0;
  }
}
