#include <bits/stdc++.h>
using namespace std;
int n, m, tot;
map<int, int> id;
int cnt[1050], f[1050][1050];
int lucky(int n) {
  for (; n; n /= 10)
    if (n % 10 != 4 && n % 10 != 7) return 0;
  return 1;
}
int pow(int a, int b, int c) {
  int ret = 1;
  while (b) {
    if (b & 1) ret = 1LL * ret * a % c;
    b >>= 1;
    a = 1LL * a * a % c;
  }
  return ret;
}
int main() {
  scanf("%d%d", &n, &m);
  int x, s = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    if (lucky(x)) {
      if (!id[x]) id[x] = ++tot;
      cnt[id[x]]++;
    } else
      s++;
  }
  f[0][0] = 1;
  for (int i = 1; i <= tot; i++) {
    f[i][0] = 1;
    for (int j = 1; j <= i; j++)
      f[i][j] = (f[i - 1][j] + 1LL * f[i - 1][j - 1] * cnt[i]) % 1000000007;
  }
  int ans = 0;
  if (s + tot < m) {
    printf("0\n");
    return 0;
  }
  int cur;
  for (int i = 0; i <= s; i++) {
    if (i > m) break;
    if (!i)
      cur = 1;
    else
      cur = 1LL * cur * (s - i + 1) % 1000000007 *
            pow(i, 1000000007 - 2, 1000000007) % 1000000007;
    if (m - i <= tot) ans = (1LL * cur * f[tot][m - i] + ans) % 1000000007;
  }
  cout << ans << endl;
  return 0;
}
