#include <bits/stdc++.h>
using namespace std;
pair<int, int> ara[20];
const long long MOD = 1e9 + 7;
int n, T;
long long dp[227][4][1 << 15];
bool Check(int mask, int pos) { return mask & (1 << pos); }
int Set(int mask, int pos) { return mask | (1 << pos); }
long long call(int Time, int genre, int mask) {
  if (Time == 0) return 1;
  if (dp[Time][genre][mask] != -1) return dp[Time][genre][mask];
  long long ret = 0;
  for (int i = 0; i < n; i++) {
    if (ara[i].second == genre) continue;
    if (Time - ara[i].first < 0) continue;
    if (Check(mask, i)) continue;
    int newmask = Set(mask, i);
    ret = ret + call(Time - ara[i].first, ara[i].second, newmask);
    ret %= MOD;
  }
  return dp[Time][genre][mask] = ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  memset(dp, -1, sizeof(dp));
  cin >> n >> T;
  for (int i = 0; i < n; i++) {
    cin >> ara[i].first >> ara[i].second;
  }
  cout << call(T, 0, 0) << "\n";
}
