#include <bits/stdc++.h>
using namespace std;
int b[1000];
vector<int> primes;
int d[1100000];
int w[1100000];
int diff[1100000];
int f[1100000];
int invf[1100000];
int pow1(int x, int y) {
  int i;
  long long ret;
  ret = 1;
  for (i = 30; i >= 0; i--) {
    ret = ret * ret % 1000000007;
    if (((1 << i) & y) != 0) ret = ret * x % 1000000007;
  }
  return (int)ret;
}
int inv(int x) { return pow1(x, 1000000007 - 2); }
int c(int x, int y) {
  if (x < y) return 0;
  return (long long)f[x] * invf[y] % 1000000007 * invf[x - y] % 1000000007;
}
vector<int> getfactors(int x) {
  int i;
  vector<int> ret;
  ret.clear();
  for (i = 1; i <= 1000; i++) {
    if (i * i > x) break;
    if (x % i == 0) {
      ret.push_back(i);
      if (x / i != i) ret.push_back(x / i);
    }
  }
  return ret;
}
int main() {
  int i, j, n, k, q, x, ans;
  vector<int> fac;
  memset(w, 0, sizeof(w));
  for (i = 1; i <= 1000000; i++) {
    diff[i] = i - w[i];
    for (j = i; j <= 1000000; j += i) w[j] += diff[i];
  }
  f[0] = 1;
  invf[0] = 1;
  for (i = 1; i <= 1000000; i++) {
    f[i] = (long long)f[i - 1] * i % 1000000007;
    invf[i] = inv(f[i]);
  }
  primes.clear();
  memset(b, 0, sizeof(b));
  for (i = 2; i < 1000; i++)
    if (b[i] == 0) {
      primes.push_back(i);
      for (j = i * i; j < 1000; j += i) b[j] = 1;
    }
  scanf("%d%d%d", &n, &k, &q);
  memset(d, 0, sizeof(d));
  for (i = 0; i < n; i++) {
    scanf("%d", &x);
    fac = getfactors(x);
    for (j = 0; j < fac.size(); j++) d[fac[j]]++;
  }
  ans = 0;
  for (i = 1; i <= 1000000; i++)
    ans = ((long long)ans + (long long)diff[i] * c(d[i], k)) % 1000000007;
  for (i = 0; i < q; i++) {
    scanf("%d", &x);
    fac = getfactors(x);
    for (j = 0; j < fac.size(); j++) {
      ans = (((long long)ans - (long long)diff[fac[j]] * c(d[fac[j]], k)) %
                 1000000007 +
             1000000007) %
            1000000007;
      d[fac[j]]++;
      ans = ((long long)ans + (long long)diff[fac[j]] * c(d[fac[j]], k)) %
            1000000007;
    }
    printf("%d\n", ans);
  }
}
