#include <bits/stdc++.h>
using namespace std;
unsigned long long hcf(unsigned long long x, unsigned long long y) {
  if (y % x == 0) return x;
  return hcf(y % x, x);
}
unsigned long long arr[300005];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  unsigned long long mn;
  cin >> mn;
  vector<unsigned long long> v;
  for (int i = 1; i < n; i++) {
    unsigned long long tmp;
    cin >> tmp;
    v.push_back(tmp - mn);
  }
  for (int i = 0; i < m; i++) cin >> arr[i];
  for (int i = 1; i < v.size(); i++)
    v[i] = hcf(min(v[i - 1], v[i]), max(v[i - 1], v[i]));
  int i;
  for (i = 0; i < m; i++) {
    if (v[n - 2] % arr[i] == 0) break;
  }
  if (i == m)
    cout << "NO";
  else {
    cout << "YES\n";
    cout << mn << " " << i + 1;
  }
}
