#include <bits/stdc++.h>
using namespace std;
const int P = 1e9 + 7;
int n, K, cnt[5];
int dp[2][51][51];
int C[55][55];
void add(int &a, int b) {
  a += b;
  if (a >= P) a -= P;
}
int main() {
  C[0][0] = 1;
  for (int i = 1; i <= 50; i++) {
    C[i][0] = C[i][i] = 1;
    for (int j = 1; j < i; j++) {
      C[i][j] = C[i - 1][j - 1] + C[i - 1][j];
      if (C[i][j] >= P) C[i][j] -= P;
    }
  }
  scanf("%d %d", &n, &K);
  K /= 50;
  int x;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    x /= 50;
    cnt[x]++;
  }
  dp[0][0][0] = 1;
  int cur = 0, ci = 0;
  while (ci < 200 && (!dp[cur][cnt[1]][cnt[2]] || ci % 2 == 0)) {
    ci++;
    cur = 1 - cur;
    memset(dp[cur], 0, sizeof(dp[cur]));
    for (int i = 0; i <= cnt[1]; i++) {
      for (int j = 0; j <= cnt[2]; j++) {
        if (dp[1 - cur][i][j] == 0) continue;
        if (ci & 1) {
          for (int a = 0; a <= cnt[1] - i; a++) {
            for (int b = 0; b <= cnt[2] - j; b++) {
              if (a == 0 && b == 0) continue;
              if (a + b * 2 > K) break;
              add(dp[cur][i + a][j + b], 1ll * dp[1 - cur][i][j] *
                                             C[cnt[1] - i][a] % P *
                                             C[cnt[2] - j][b] % P);
            }
          }
        } else {
          for (int a = 0; a <= i; a++) {
            for (int b = 0; b <= j; b++) {
              if (a == 0 && b == 0) continue;
              if (a + b * 2 > K) break;
              add(dp[cur][i - a][j - b],
                  1ll * dp[1 - cur][i][j] * C[i][a] % P * C[j][b] % P);
            }
          }
        }
      }
    }
  }
  printf("%d\n", ci >= 200 ? -1 : ci);
  printf("%d\n", dp[cur][cnt[1]][cnt[2]]);
  return 0;
}
