#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long findGCD(long long arr[], int n) {
  long long result = arr[0];
  for (int i = 1; i < n; i++) result = gcd(arr[i], result);
  return result;
}
int main() {
  long n, m, i, flag = 0;
  cin >> n >> m;
  long long a[n], b[m], c[n - 1], p, ans;
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < m; i++) cin >> b[i];
  for (i = 0; i < n - 1; i++) {
    c[i] = a[i + 1] - a[i];
  }
  p = findGCD(c, n - 1);
  for (i = 0; i < m; i++) {
    if (p % b[i] == 0) {
      ans = i + 1;
      flag = 1;
      break;
    }
  }
  if (flag == 1)
    cout << "YES" << endl << a[0] << " " << ans;
  else
    cout << "NO";
  return 0;
}
