#include <bits/stdc++.h>
using namespace std;
long long arr[300001], p;
bool use[300001];
long long x = 1000000000000000000, y, nn;
vector<long long> vec;
set<long long> sss;
void prime(long long cur) {
  for (long long i = 1; i * i <= cur; i++) {
    if (cur % i == 0) {
      sss.insert(i);
      sss.insert(cur / i);
    }
  }
}
long long gcd(long long x, long long y) {
  long long tmp;
  if (y > x) swap(x, y);
  while (y > 0) {
    tmp = x;
    x = y;
    y = tmp % y;
  }
  return x;
}
int main() {
  int n, m, ans = -1;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &arr[i]);
  }
  x = arr[1] - arr[0];
  for (int i = 2; i < n; i++) {
    x = gcd(x, arr[i] - arr[i - 1]);
    nn = arr[i];
  }
  for (int i = 0; i < m; i++) {
    scanf("%lld", &y);
    if (x % y == 0) {
      printf("YES\n");
      printf("%lld %d", arr[0], i + 1);
      return 0;
    }
  }
  printf("NO");
  return 0;
}
