#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int main() {
  int n, m;
  cin >> n >> m;
  long long x[n - 1];
  long long first;
  cin >> first;
  for (int i = 0; i < n - 1; i++) {
    cin >> x[i];
    x[i] -= first;
  }
  long long ke[m];
  long long allgcd = x[0];
  for (int i = 1; i < n - 1; i++) {
    allgcd = gcd(allgcd, x[i]);
  }
  for (int i = 0; i < m; i++) {
    cin >> ke[i];
  }
  for (int i = 0; i < m; i++) {
    if (allgcd % ke[i] == 0) {
      cout << "YES" << endl;
      cout << first << ' ' << i + 1;
      return 0;
    }
  }
  cout << "NO";
}
