#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c h, c n) {
  return {h, n};
}
template <class c>
auto dud(c* r) -> decltype(cerr << *r);
template <class c>
char dud(...);
struct muu {
  template <class c>
  muu& operator<<(const c&) {
    return *this;
  }
  muu& operator()() { return *this; }
};
constexpr int32_t fx[4][2] = {{0, 1}, {0, -1}, {1, 1}, {1, -1}};
constexpr int32_t fxx[8][2] = {{0, 1}, {0, -1}, {1, 0},  {-1, 0},
                               {1, 1}, {1, -1}, {-1, 1}, {-1, -1}};
using ll = int64_t;
using ull = uint64_t;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vii = vector<pii>;
using vll = vector<ll>;
constexpr int32_t INF = int32_t(2e9);
constexpr int64_t LLINF = (int64_t)1e15;
constexpr int64_t MOD = (int64_t)1e9 + 7;
const uint32_t MAX_SEGMENT_ENDING = int32_t(1e5 + 1);
const uint32_t SEG_TREE_HEIGHT = (uint32_t)floor(log2(MAX_SEGMENT_ENDING)) + 1u;
const uint32_t SEG_TREE_SIZE = 1u << SEG_TREE_HEIGHT;
const uint32_t FIRST_LEAF = SEG_TREE_SIZE >> 1u;
template <typename ForwardIterator, typename T>
ForwardIterator largest_less_than_or_equal_to(ForwardIterator first,
                                              ForwardIterator last,
                                              const T& val) {
  ForwardIterator it = upper_bound(first, last, val);
  if (it == first) return nullptr;
  return --it;
}
template <typename T>
void minn(T& a, T b) {
  if (a > b) a = b;
}
template <typename T>
void maxx(T& a, T b) {
  if (a < b) a = b;
}
struct FindUnion {
  vector<int> rep;
  vector<int> rankk;
  FindUnion(int n) {
    rep.resize(n + 1);
    rankk.resize(n + 1);
    for (int i = 0; i <= n; i++) init(i);
  }
  void init(int x) {
    rep[x] = x;
    rankk[x] = 0;
  }
  int find(int x) {
    if (rep[x] != x) rep[x] = find(rep[x]);
    return rep[x];
  }
  void unia(int x, int y) {
    int rx = find(x);
    int ry = find(y);
    if (rankk[rx] > rankk[ry]) {
      rep[ry] = rx;
    } else {
      rep[rx] = ry;
      if (rankk[ry] == rankk[rx]) rankk[ry]++;
    }
  }
};
struct HashDS {
  const int64_t p1 = 31;
  const int64_t p2 = 53;
  const int64_t MOD = int64_t(1e9 + 7);
  size_t string_max_len = 0;
  bool double_hashing;
  vector<int32_t> p1_powers;
  vector<int32_t> p2_powers;
  HashDS() = default;
  HashDS(size_t _string_max_len, bool _double_hashing = false) {
    double_hashing = _double_hashing;
    string_max_len = _string_max_len;
    p1_powers.resize(string_max_len);
    if (double_hashing) p2_powers.resize(string_max_len);
    generate_powers();
  }
  void resize(int32_t n, bool _double_hashing = false) {
    double_hashing = _double_hashing;
    string_max_len = n;
    p1_powers.resize(string_max_len);
    if (double_hashing) p2_powers.resize(string_max_len);
    generate_powers();
  }
  void generate_powers() {
    p1_powers[0] = 1;
    for (int i = 1; i < string_max_len; i++)
      p1_powers[i] = int64_t(p1_powers[i - 1]) * p1 % MOD;
    if (double_hashing) {
      p2_powers[0] = 1;
      for (int i = 1; i < string_max_len; i++)
        p2_powers[i] = int64_t(p2_powers[i - 1]) * p2 % MOD;
    }
  }
  static int map_character(char c) {
    return isupper(c) ? c - 'A' + 26 + 1 : c - 'a' + 1;
  }
  int32_t hash(const string& str, int32_t a = 0, int32_t b = -1) {
    int64_t hash_val = 0;
    int step = 0;
    if (b == -1) b = str.length() - 1;
    for (int i = a; i <= b; i++)
      hash_val =
          (hash_val + (map_character(str[i])) * int64_t(p1_powers[step++])) %
          MOD;
    return hash_val;
  }
  int32_t hash2(const string& str, int32_t a = 0, int32_t b = -1) {
    int64_t hash_val = 0;
    int step = 0;
    if (b == -1) b = str.length();
    for (int i = a; i <= b; i++)
      hash_val =
          (hash_val + (map_character(str[i])) * int64_t(p2_powers[step++])) %
          MOD;
    return hash_val;
  }
  pair<int32_t, int32_t> double_hash(const string& str) {
    return {hash(str), hash2(str)};
  }
  vector<int32_t> generate_prefix_hashes(const string& str) {
    vector<int32_t> pref_hash = vector<int32_t>(str.length() + 1, 0);
    for (int i = 0; i < str.length(); i++)
      pref_hash[i + 1] =
          (int64_t(pref_hash[i]) +
           int64_t(map_character(str[i])) * int64_t(p1_powers[i])) %
          MOD;
    return pref_hash;
  }
  int32_t substring_hash(const string& s, vector<int32_t>& pref_hash, int32_t i,
                         int32_t j) {
    return ((int64_t(((pref_hash[j + 1] - pref_hash[i] % MOD) + MOD) % MOD) *
             int64_t(p1_powers[s.length() - i - 1]) % MOD) +
            MOD) %
           MOD;
  }
  int64_t count_unique_substrings(const string& s, vector<int32_t>& pref_hash) {
    int64_t res = 0;
    for (int l = 1; l <= s.length(); l++) {
      set<int32_t> hashes;
      for (int i = 0; i + l <= s.length(); i++)
        hashes.insert(((((pref_hash[i + l] - pref_hash[i] % MOD) + MOD) % MOD *
                        p1_powers[s.length() - i - 1] % MOD) +
                       MOD) %
                      MOD);
      res += hashes.size();
    }
    return res;
  }
};
bool binsearch_test() {}
int binsearch(int poc, int kon) {
  int best = -1, mid;
  while (poc <= kon) {
    mid = (poc + kon) >> 1u;
    if (binsearch_test()) {
      best = mid;
      poc = mid + 1;
    } else {
      kon = mid - 1;
    }
  }
  return best;
}
constexpr int32_t MAXN = int32_t(3e5 + 5);
int n, m;
ll arr[MAXN];
ll parr[MAXN];
ll start;
void init() {}
void input() {
  cin >> n >> m;
  for (int i = 0; i < n; ++i) cin >> arr[i];
  for (int i = 0; i < m; ++i) cin >> parr[i];
  start = arr[0];
}
ll nwd(ll a, ll b) {
  ll tmp;
  while (b > 0) {
    tmp = b;
    b = a % b;
    a = tmp;
  }
  return a;
}
void solve() {
  for (int i = n - 1; i > 0; i--) arr[i] = arr[i] - arr[i - 1];
  arr[0] = 0;
  (muu() << __FUNCTION__ << "#" << 267 << ": ") << "["
                                                   "arr"
                                                   ": "
                                                << (arr) << "] ";
  ll nwwd = arr[0];
  for (int i = 1; i < n; ++i) {
    nwwd = nwd(arr[i], nwwd);
  }
  (muu() << __FUNCTION__ << "#" << 270 << ": ") << nwwd;
  for (int i = 0; i < m; ++i) {
    if (nwwd % parr[i] == 0) {
      cout << "YES\n";
      cout << start << " " << i + 1 << endl;
      exit(0);
    }
  }
  cout << "NO\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  init();
  input();
  solve();
  return 0;
}
