#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 7, M = 1e9 + 7;
long long power(long long a, long long p) {
  if (p == 0) return 1;
  long long ans = power(a, p / 2);
  ans = (ans * ans) % M;
  if (p % 2) ans = (ans * a) % M;
  return ans;
}
long long fac[N];
long long invfac[N];
long long cont[N];
int cnt[N];
int phi[N];
void pre() {
  fac[0] = 1;
  for (int i = 1; i < N; i++) fac[i] = (fac[i - 1] * i) % M;
  invfac[N - 1] = power(fac[N - 1], M - 2);
  for (int i = N - 2; i >= 0; i--) invfac[i] = (invfac[i + 1] * (i + 1)) % M;
  for (int i = 1; i < N; i++) phi[i] = i;
  for (int i = 2; i < N; i++)
    if (phi[i] == i)
      for (int j = i; j < N; j += i) phi[j] = (phi[j] / i) * (i - 1);
}
long long C(int n, int k) {
  if (k < 0 || k > n) return 0;
  long long denom = (invfac[n - k] * invfac[k]) % M;
  return (fac[n] * denom) % M;
}
long long ans = 0;
int k;
void add(int x) {
  vector<int> fac;
  for (int i = 1; i * i <= x; i++) {
    if (x % i) continue;
    fac.push_back(i);
    if (x / i != i) fac.push_back(x / i);
  }
  for (int x : fac) {
    ans -= cont[x];
    cnt[x]++;
    cont[x] = (C(cnt[x], k) * phi[x]) % M;
    ans += cont[x];
  }
  ans = (ans % M + M) % M;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  pre();
  int n, q;
  cin >> n >> k >> q;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    add(x);
  }
  for (int i = 1; i <= q; i++) {
    int x;
    cin >> x;
    add(x);
    cout << ans << "\n";
  }
}
