#include <bits/stdc++.h>
using namespace std;
long long int n, m, x[300005], p[300005], a[300005];
long long int GCD(long long int a, long long int b) {
  if (b == 0) return a;
  return GCD(b, a % b);
}
long long int ArrayGCD(int from, int to) {
  if (from == to)
    return a[from];
  else if (from == to - 1)
    return GCD(a[from], a[to]);
  else {
    int mid = (from + to) / 2;
    long long int l = ArrayGCD(from, mid);
    long long int r = ArrayGCD(mid + 1, to);
    return GCD(l, r);
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < m; i++) cin >> p[i];
  for (int i = 1; i < n; i++) a[i - 1] = x[i] - x[0];
  long long int arrayGCD = ArrayGCD(0, n - 2);
  bool result = false;
  int chosenP;
  for (int i = 0; i < m; i++)
    if (arrayGCD % p[i] == 0) {
      result = true;
      chosenP = i + 1;
      break;
    }
  if (result == true)
    cout << "YES"
         << "\n"
         << x[0] << " " << chosenP;
  else
    cout << "NO";
}
