#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double eps = 1e-8;
inline int _max(int a, int b) { return a > b ? a : b; }
inline int _min(int a, int b) { return a < b ? a : b; }
inline int _abs(int a) { return a > 0 ? a : -a; }
inline double _max(double a, double b) { return a > b ? a : b; }
inline double _min(double a, double b) { return a < b ? a : b; }
inline double _fabs(double a) { return a > 0 ? a : -a; }
inline long long _max(long long a, long long b) { return a > b ? a : b; }
inline long long _min(long long a, long long b) { return a < b ? a : b; }
inline long long _labs(long long a) { return a > 0 ? a : -a; }
int sgn(double x) {
  if (_fabs(x) < eps)
    return 0;
  else if (x < 0)
    return -1;
  else
    return 1;
}
int n, m;
const int MAXN = 3e5 + 10;
long long num[MAXN];
long long x[MAXN];
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long mid[MAXN];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%lld", &x[i]);
    mid[i] = x[i] - x[i - 1];
  }
  for (int i = 1; i <= m; ++i) scanf("%lld", &num[i]);
  long long res = mid[2];
  for (int i = 3; i <= n; ++i) res = gcd(res, mid[i]);
  for (int i = 1; i <= m; ++i) {
    if (res % num[i] == 0) {
      printf("YES\n");
      printf("%lld %d", x[1], i);
      return 0;
    }
  }
  printf("NO\n");
}
