#include <bits/stdc++.h>
using namespace std;
const int N = 300005;
long long a[N], p[N];
int n, m;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%lld", a + i);
  for (int i = 1; i <= m; i++) scanf("%lld", p + i);
  long long t = a[1] - a[0], x;
  for (int i = 2; i < n; i++) {
    t = gcd(t, a[i] - a[i - 1]);
  }
  for (int i = 1; i <= m; i++) {
    if (t % p[i] == 0) {
      printf("YES\n");
      printf("%lld %d\n", a[0], i);
      return 0;
    }
  }
  printf("NO\n");
  return 0;
}
