#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) {
  if (!y) return x;
  return gcd(y, x % y);
}
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
bool sortbysecinrev(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second > b.second);
}
bool sortbysize(string &s1, string &s2) { return s1.size() < s2.size(); }
bool sortinrev(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.first > b.first);
}
bool sortcol(const vector<int> &v1, const vector<int> &v2) {
  return v1[0] < v2[0];
}
int proceed() {
  long long n, m, x = 0, i;
  cin >> n >> m;
  long long a[n], b[m];
  map<long long, long long> mp;
  for (i = 0; i < n; ++i) {
    cin >> a[i];
    if (i > 0) x = gcd(x, a[i] - a[i - 1]);
  }
  for (i = 0; i < m; ++i) {
    cin >> b[i];
    mp[b[i]] = i + 1;
  }
  for (auto i : mp) {
    if (i.first > x) break;
    if (x % i.first == 0) {
      cout << "YES"
           << "\n";
      cout << a[0] << " " << i.second << "\n";
      return 0;
    }
  }
  cout << "NO"
       << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int t = 1, i = 0;
  while (t--) {
    ;
    proceed();
  }
  return 0;
}
