#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10, MOD = 1e9 + 7;
int n, m, q;
int flag[N], tot, pr[N], phi[N];
long long fac[N], inv[N];
long long Power(long long a, long long b) {
  long long c = 1;
  for (; b; b >>= 1) {
    if (b & 1) (c *= a) %= MOD;
    (a *= a) %= MOD;
  }
  return c;
}
void Init() {
  phi[1] = 1;
  for (int i = 2; i < N; ++i) {
    if (!flag[i]) {
      pr[++tot] = i;
      phi[i] = i - 1;
    }
    for (int j = 1; j <= tot; ++j) {
      int k = pr[j];
      if (i * k >= N) break;
      flag[i * k] = k;
      if (i % k == 0) {
        phi[i * k] = phi[i] * k;
        break;
      } else
        phi[i * k] = phi[i] * phi[k];
    }
  }
  fac[0] = inv[0] = 1;
  for (int i = 1; i < N; ++i) fac[i] = fac[i - 1] * i % MOD;
  inv[N - 1] = Power(fac[N - 1], MOD - 2);
  for (int i = N - 2; i; --i) inv[i] = inv[i + 1] * (i + 1) % MOD;
}
int cnt[N];
inline long long C(int m, int n) {
  if (n > m) return 0;
  return fac[m] * inv[n] % MOD * inv[m - n] % MOD;
}
void Solve() {
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= n; ++i) {
    int x;
    scanf("%d", &x);
    for (int y = 1; y * y <= x; ++y)
      if (x % y == 0) {
        ++cnt[y];
        if (x / y != y) ++cnt[x / y];
      }
  }
  int ans = 0;
  for (int i = 1; i < N; ++i) ans = (ans + C(cnt[i], m) * phi[i] % MOD) % MOD;
  for (int i = 1; i <= q; ++i) {
    int x;
    scanf("%d", &x);
    for (int y = 1; y * y <= x; ++y)
      if (x % y == 0) {
        ans = (ans - C(cnt[y], m) * phi[y] % MOD) % MOD;
        ++cnt[y];
        ans = (ans + C(cnt[y], m) * phi[y] % MOD) % MOD;
        if (x / y != y) {
          ans = (ans - C(cnt[x / y], m) * phi[x / y] % MOD) % MOD;
          ++cnt[x / y];
          ans = (ans + C(cnt[x / y], m) * phi[x / y] % MOD) % MOD;
        }
      }
    ans = (ans + MOD) % MOD;
    printf("%d\n", ans);
  }
}
int main() {
  Init();
  Solve();
  return 0;
}
