#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int main() {
  int n, m;
  long long int start, cur, prev, inter = 0;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    if (i == 0) {
      cin >> start;
      prev = start;
    } else {
      cin >> cur;
      if (inter != 1) inter = gcd(inter, cur - prev);
      prev = cur;
    }
  }
  for (int i = 1; i <= m; i++) {
    cin >> cur;
    if (inter % cur == 0) {
      cout << "YES\n" << start << " " << i;
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
