#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int N, M;
  cin >> N >> M;
  vector<long long> A(N, 0);
  vector<long long> P(M, 0);
  for (int i = 0; i < N; i++) cin >> A[i];
  for (int i = 0; i < M; i++) cin >> P[i];
  long long PRIMERO = A[0];
  for (int i = 0; i < N; i++) {
    A[i] -= PRIMERO;
  }
  long long GCD = A[1];
  for (int i = 2; i < N; i++) {
    GCD = gcd(GCD, A[i]);
  }
  for (int i = 0; i < M; i++) {
    if (GCD % P[i] == 0) {
      cout << "YES" << endl;
      cout << PRIMERO << " " << i + 1 << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
}
