#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  int n, m;
  scanf(" %d %d", &n, &m);
  long long nums[n];
  long long less[n - 1];
  for (int i = 0; i < n; ++i) cin >> nums[i];
  for (int i = 0; i < n - 1; ++i) less[i] = nums[i + 1] - nums[i];
  long long gg = less[0];
  for (int i = 0; i < n - 1; ++i) gg = gcd(gg, less[i]);
  map<long long, int> tr;
  for (int i = 0; i < m; ++i) {
    long long val;
    cin >> val;
    tr[val] = i;
  }
  for (const auto &pa : tr) {
    if (gg % pa.first == 0) {
      puts("YES");
      cout << nums[0] << " " << pa.second + 1 << endl;
      return 0;
    }
  }
  puts("NO");
  return 0;
}
