#include <bits/stdc++.h>
using namespace std;
int main() {
  ifstream fin("input.txt");
  int n, k;
  cin >> n >> k;
  vector<int> v(n + 1);
  for (int i = 1; i <= n; i++) cin >> v[i];
  sort(v.begin(), v.end());
  int ans = v[1];
  for (; ans >= 1;) {
    int i;
    for (i = 1; i <= n; i++) {
      if (v[i] % ans > k) {
        int tmp = v[i] / ans;
        tmp++;
        ans = v[i] / tmp;
        break;
      }
    }
    if (i == n + 1) break;
  }
  cout << ans << endl;
  cin.get();
}
