#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int dp[1055][1055];
int fact[100005];
int rev[100005];
int arr[100005];
int n, k;
int cnt;
int ans;
int sz;
void addMod(int &a, int b) {
  a += b;
  if (mod <= a) {
    a -= mod;
  }
}
int binPow(int a, int b) {
  int ret = 1;
  for (; b > 0; b >>= 1) {
    if (b & 1) {
      ret = (ret * 1ll * a) % mod;
    }
    a = (a * 1ll * a) % mod;
  }
  return ret;
}
void pre() {
  fact[0] = 1;
  for (int i = 1; i <= 100000; ++i) {
    fact[i] = (fact[i - 1] * 1ll * i) % mod;
  }
  for (int i = 0; i <= 100000; ++i) {
    rev[i] = binPow(fact[i], mod - 2);
  }
}
bool lucky(int x) {
  bool ret = 1;
  while (x > 0) {
    int last = (x % 10);
    if (last != 4 && last != 7) {
      ret = 0;
    }
    x /= 10;
  }
  return ret;
}
int C(int n, int k) {
  if (n < k || n < 0 || k < 0) {
    return 0;
  }
  return 1ll * fact[n] * rev[k] % mod * rev[n - k] % mod;
}
void solve() {
  scanf("%d %d", &n, &k);
  for (int i = 1, x; i <= n; ++i) {
    scanf("%d", &x);
    if (lucky(x)) {
      arr[++sz] = x;
    } else {
      ++cnt;
    }
  }
  sort(arr + 1, arr + sz + 1);
  n = 0;
  for (int l = 1, r; l <= sz; l = r) {
    r = l;
    while (r <= sz && arr[l] == arr[r]) {
      ++r;
    }
    arr[++n] = r - l;
  }
  dp[0][0] = 1;
  for (int i = 1; i <= n; ++i) {
    dp[i][0] = 1;
    for (int j = 1; j <= i; ++j) {
      addMod(dp[i][j], dp[i - 1][j]);
      addMod(dp[i][j], dp[i - 1][j - 1] * 1ll * arr[i] % mod);
    }
  }
  for (int i = 0; i <= n; ++i) {
    addMod(ans, dp[n][i] * 1ll * C(cnt, k - i) % mod);
  }
  printf("%d\n", ans);
}
int main() {
  int tt = 1;
  pre();
  while (tt--) {
    solve();
  }
  return 0;
}
