#include <bits/stdc++.h>
using namespace std;
const long long hmod1 = 999999937;
const long long hmod2 = 1000000000 + 9;
const long long INF = 1 << 30;
const long long INFLL = 1LL << 62;
const long double EPS = 1e-12;
const long long mod = 998244353;
const long long dx4[4] = {1, 0, -1, 0};
const long long dy4[4] = {0, 1, 0, -1};
const long long dx8[8] = {1, 1, 1, 0, 0, -1, -1, -1};
const long long dy8[8] = {0, 1, -1, 1, -1, 0, 1, -1};
const long double pi = 3.141592653589793;
void dump_func() { cout << endl; };
template <class Head, class... Tail>
void dump_func(Head&& head, Tail&&... tail) {
  cout << head;
  if (sizeof...(Tail) == 0)
    cout << " ";
  else
    cout << ", ";
  dump_func(std::move(tail)...);
}
template <typename T>
ostream& operator<<(ostream& os, vector<T>& vec) {
  os << "[";
  for (long long i = 0; i < vec.size(); i++)
    os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
  os << "]";
  return os;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, pair<T, U>& pair_var) {
  os << "(" << pair_var.first << ", " << pair_var.second << ")";
  return os;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, map<T, U>& map_var) {
  os << "[";
  for (auto itr = map_var.begin(); itr != map_var.end(); itr++) {
    os << "(" << itr->first << ", " << itr->second << ")";
    itr++;
    if (itr != map_var.end()) os << ", ";
    itr--;
  }
  os << "]";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, set<T>& set_var) {
  os << "[";
  for (auto itr = set_var.begin(); itr != set_var.end(); itr++) {
    os << *itr;
    ++itr;
    if (itr != set_var.end()) os << ", ";
    itr--;
  }
  os << "]";
  return os;
}
long long n, m;
long long x[300000 + 5], p[300000 + 5];
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (long long i = 0; i < (n); i++) cin >> x[i];
  for (long long i = 0; i < (m); i++) cin >> p[i];
  long long g = 0;
  for (long long i = 0; i < (n - 1); i++) g = gcd(g, x[i + 1] - x[i]);
  long long ansp = -1;
  for (long long i = 0; i < (m); i++) {
    if (g % p[i] == 0) {
      ansp = i + 1;
    }
  }
  if (ansp == -1) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  cout << x[0] << " " << ansp << endl;
}
