#include <bits/stdc++.h>
long long c[300001], d[300001];
using namespace std;
int main() {
  long long n, m, l, r, a, b, k = 0;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> c[i];
  }
  for (int i = 1; i <= m; i++) {
    cin >> d[i];
  }
  l = c[2] - c[1];
  for (int i = 3; i <= n; i++) {
    r = c[i] - c[i - 1];
    a = l;
    b = r;
    while (a * b > 0) {
      if (a > b) {
        a = a % b;
      } else
        b = b % a;
    }
    l = a + b;
  }
  for (int i = 1; i <= m; i++) {
    if (l % d[i] == 0) {
      cout << "YES" << endl;
      cout << (long long)c[1] << " " << i;
      break;
    } else
      k++;
  }
  if (k == m) {
    cout << "NO";
  }
}
