#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using db = double;
using str = string;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using pd = pair<db, db>;
using pld = pair<ld, ld>;
using vi = vector<int>;
using vd = vector<db>;
using vld = vector<ld>;
using vl = vector<ll>;
using vs = vector<str>;
using vc = vector<char>;
using vpi = vector<pi>;
using vpl = vector<pl>;
using vpd = vector<pd>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using vvc = vector<vc>;
const int MX = 2e5 + 5;
const long long INF = 1e18;
const long long MOD = 998244353;
const long double PI = acos((ld)-1);
const long double EPS = 1e-18;
template <class A>
void re(complex<A>& c);
template <class A, class B>
void re(pair<A, B>& p);
template <class A>
void re(vector<A>& v);
template <class A, size_t SZ>
void re(array<A, SZ>& a);
template <class T>
void re(T& x) {
  cin >> x;
}
void re(db& d) {
  string t;
  re(t);
  d = stod(t);
}
void re(ld& d) {
  string t;
  re(t);
  d = stold(t);
}
template <class H, class... T>
void re(H& h, T&... t) {
  re(h);
  re(t...);
}
template <class A>
void re(complex<A>& c) {
  A a, b;
  re(a, b);
  c = {a, b};
}
template <class A, class B>
void re(pair<A, B>& p) {
  re(p.first, p.second);
}
template <class A>
void re(vector<A>& x) {
  for (auto& i : x) re(i);
}
template <class A, size_t SZ>
void re(array<A, SZ>& x) {
  for (auto& i : x) re(i);
}
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rand(ll a, ll b) { return uniform_int_distribution<ll>(a, b)(rng); }
string to_string(char c) { return string(1, c); }
string to_string(bool b) { return b ? "true" : "false"; }
string to_string(const char* second) { return (string)second; }
string to_string(string second) { return second; }
template <class A>
string to_string(complex<A> c) {
  stringstream ss;
  ss << c;
  return ss.str();
}
string to_string(vector<bool> v) {
  string res = "{";
  for (int i = 0; i < ((int)(v).size()); i++) {
    res += char('0' + v[i]);
  }
  res += "}";
  return res;
}
template <size_t SZ>
string to_string(bitset<SZ> b) {
  string res = "";
  for (int i = 0; i < SZ; i++) {
    res += char('0' + b[i]);
  }
  return res;
}
template <class A, class B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <class T>
string to_string(T v) {
  bool fst = 1;
  string res = "{";
  for (const auto& x : v) {
    if (!fst) {
      res += ", ";
    }
    fst = 0;
    res += to_string(x);
  }
  res += "}";
  return res;
}
void DBG() { cerr << "]" << endl; }
template <class H, class... T>
void DBG(H h, T... t) {
  cerr << to_string(h);
  if (sizeof...(t)) {
    cerr << ", ";
  }
  DBG(t...);
}
void EDBG(string names) { names = names; }
template <class H, class... T>
void EDBG(string names, H h, T... t) {
  auto pos = names.find(',');
  auto first_name = names.substr(0, pos);
  auto rest = names.substr(pos + 1);
  while (rest.front() == ' ') {
    rest = rest.substr(1);
  }
  cerr << "[" << first_name << "]: [" << to_string(h) << "]"
       << "\n";
  EDBG(rest, t...);
}
void pr() {}
template <class H, class... T>
void pr(const H& a, const T&... b) {
  cout << a;
  pr(b...);
}
void ps() { cout << "\n"; }
template <class H, class... T>
void ps(const H& a, const T&... b) {
  pr(a, ' ');
  ps(b...);
}
void setIn(string second) { freopen(second.c_str(), "r", stdin); }
void setOut(string second) { freopen(second.c_str(), "w", stdout); }
void unsyncIO() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(20);
}
void setIO(string second = "") {
  unsyncIO();
  if (((int)(second).size())) {
    setIn(second + ".in");
    setOut(second + ".out");
  }
}
template <class T>
void uni(vector<T>& v) {
  sort(begin(v), end(v));
  v.erase(unique(begin(v), end(v)), end(v));
}
ll cdiv(ll a, ll b) { return a / b + ((a ^ b) > 0 && a % b); }
ll fdiv(ll a, ll b) { return a / b + ((a ^ b) < 0 && a % b); }
bool even(ll a) { return !(a & 1); }
bool odd(ll a) { return (a & 1); }
ll ggcd(ll a, ll b) {
  if (!a || !b) {
    return a | b;
  }
  ll shift = __builtin_ctz(a | b);
  do {
    b >>= __builtin_ctz(b);
    if (a > b) {
      swap(a, b);
    }
    b -= a;
  } while (b);
  return a << shift;
}
ll gld(ll a, ll b) { return (a - (a % b)); }
ll llcm(ll a, ll b) { return (a / (ggcd(a, b)) * b); }
ll power(ll a, ll b, ll c) {
  ll res = 1;
  a %= c;
  while (b > 0) {
    if (odd(b)) res = res * a % c;
    a = a * a % c;
    b >>= 1;
  }
  return res;
}
ll power(ll a, ll b) {
  ll res = 1;
  while (b > 0) {
    if (odd(b)) res = res * a;
    a = a * a;
    b >>= 1;
  }
  return res;
}
bool prime(ll a) {
  if (a < 2) {
    return false;
  }
  if (a <= 3) {
    return true;
  }
  if (a % 2 == 0 || a % 3 == 0 || (a % 5 == 0 && a != 5) ||
      (a % 7 == 0 && a != 7) || (a % 11 == 0 && a != 11) ||
      (a % 13 == 0 && a != 13) || (a % 17 == 0 && a != 17) ||
      (a % 23 == 0 && a != 23) || (a % 29 == 0 && a != 29) ||
      (a % 31 == 0 && a != 31) || (a % 37 == 0 && a != 37) ||
      (a % 41 == 0 && a != 41) || (a % 43 == 0 && a != 43) ||
      (a % 47 == 0 && a != 47) || (a % 53 == 0 && a != 53) ||
      (a % 59 == 0 && a != 59) || (a % 61 == 0 && a != 61) ||
      (a % 67 == 0 && a != 67) || (a % 67 == 0 && a != 67)) {
    return false;
  }
  if ((a % 71 == 0 && a != 71) || (a % 73 == 0 && a != 73) ||
      (a % 79 == 0 && a != 79) || (a % 83 == 0 && a != 83) ||
      (a % 89 == 0 && a != 89) || (a % 97 == 0 && a != 97)) {
    return false;
  }
  if ((a % 101 == 0 && a != 101) || (a % 103 == 0 && a != 103) ||
      (a % 107 == 0 && a != 107) || (a % 109 == 0 && a != 109) ||
      (a % 113 == 0 && a != 113) || (a % 127 == 0 && a != 127) ||
      (a % 131 == 0 && a != 131) || (a % 139 == 0 && a != 139) ||
      (a % 149 == 0 && a != 149) || (a % 151 == 0 && a != 151) ||
      (a % 157 == 0 && a != 157) || (a % 163 == 0 && a != 163) ||
      (a % 167 == 0 && a != 167) || (a % 173 == 0 && a != 173) ||
      (a % 179 == 0 && a != 179) || (a % 181 == 0 && a != 181) ||
      (a % 191 == 0 && a != 191)) {
    return false;
  }
  if ((a % 193 == 0 && a != 193) || (a % 197 == 0 && a != 197) ||
      (a % 199 == 0 && a != 199)) {
    return false;
  }
  for (ll i = 5; i * i <= a; i += 6) {
    if (a % i == 0 || a % (i + 2) == 0) {
      return false;
    }
  }
  return true;
}
int n, m;
ll sum;
vl a, b;
int main() {
  setIO();
  re(n, m);
  a.resize(n);
  b.resize(m);
  re(a, b);
  for (int i = 1; i < n; i++) {
    if (i == 1) {
      sum = a[i] - a[i - 1];
    } else {
      sum = ggcd(a[i] - a[i - 1], sum);
    }
  }
  42;
  for (int i = 0; i < m; ++i) {
    if (sum % b[i] == 0) {
      ps("YES");
      ps(a[0], i + 1);
      return 0;
    }
  }
  ps("NO");
}
