#include <bits/stdc++.h>
using namespace std;
const int N = 300005, M = 1000000007, BIG = 0x3f3f3f3f;
long long GCD(long long _a, long long _b) { return _b ? GCD(_b, _a % _b) : _a; }
int n, m;
long long x[N], p[N];
bool Read() {
  cin >> n;
  if (cin.eof()) return 0;
  cin >> m;
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 1; i <= m; i++) cin >> p[i];
  return 1;
}
vector<long long> Get_Divs(long long _x) {
  vector<long long> dv;
  long long i = 1;
  for (; i * i < _x; i++)
    if (_x % i == 0) {
      dv.push_back(i);
      dv.push_back(_x / i);
    }
  if (i * i == _x && _x % i == 0) dv.push_back(i);
  sort(begin(dv), end(dv));
  return dv;
}
void Process() {
  long long y = x[0], g = 0;
  for (int i = 1; i < n; i++) g = GCD(g, x[i] - y);
  for (int i = 1; i <= m; i++)
    if (g % p[i] == 0) {
      cout << "YES\n";
      cout << y << " " << i << "\n";
      return;
    }
  cout << "NO\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  while (Read()) Process();
  return 0;
}
