module mod_modulo_operations
  implicit none
  integer(8), parameter :: md = 1000000007_8
  integer(8) :: f(0:100000), invf(0:100000)
  integer(8) :: dp(0:200,0:100000)
  integer :: s(200), leq(100000)
contains
  subroutine init(n)
    implicit none
    integer, intent(in) :: n
    integer :: i
    f = 0_8
    invf = 0_8
    f(0) = 1_8
    invf(0) = 1_8
    dp = -1_8
    do i = 1, n
      f(i) = mod(f(i-1)*int(i,8),md)
      invf(i) = inv(f(i))
    end do
    return
  end subroutine init
  integer(8) function perm(n,k)
    implicit none
    integer, intent(in) :: n, k
    perm = 0_8
    if (n.lt.0.or.k.gt.n) return
    perm = mod(f(n)*invf(n-k),md)
    return
  end function perm
  integer(8) function comb(n,k)
    implicit none
    integer, intent(in) :: n, k
    comb = mod(perm(n,k)*invf(k),md)
    return
  end function comb
  function inv(n) result(y)
    implicit none
    integer(8), intent(in) :: n
    integer(8) :: a, b, x, y, t, q
    a = mod(n,md)
    b = md
    x = 0
    y = 1
    do while(b.ne.0_8)
      q = a/b
      t = b
      b = mod(a,b)
      a = t
      t = y
      y = x
      x = t-q*x
    end do
    do while (y.lt.0_8)
      y = y+md
    end do
    y = mod(y,md)
    return
  end function inv
  recursive function dfs(n,x) result(c)
    implicit none
    integer :: n, x, sml, big, i
    integer(8) :: c, k
    c = dp(n,x)
    if (c.ge.0_8) return
    c = int(x,8)
    if (n.eq.0) return
    c = 0_8
    if (x.eq.0) return
    sml = leq(x)
    big = n-sml+1
    c = mod(f(n)*int(x,8),md)
    if (sml.eq.1) return
    k = mod(comb(n,sml-1)*f(big),md)
    c = 0_8
    do i = 1, sml-1
      c = mod(c+dfs(sml-2,mod(x,s(i))),md)
    end do
    c = mod(k*c,md)
    dp(n,x) = c
    return
  end function dfs
end module mod_modulo_operations
program modulo_operations
  use mod_modulo_operations
  implicit none
  integer :: n, x, i, j
  s = 0
  leq = 0
  read(*,*) n, x
  read(*,*) s(1:n)
  call quick_sort(s(1:n))
  j = 1
  do i = 1, 100000
    do while (j.le.n.and.s(j).le.i)
      j = j+1
    end do
    leq(i) = j
  end do
  call init(100000)
  write(*,'(i0)') dfs(n,x)
  stop
contains
  recursive subroutine quick_sort(a)
    implicit none
    integer, intent(inout) :: a(:)
    integer :: n, l, r, p, c
    n = size(a)
    l = 1
    r = n
    p = a((l+r)/2)+a(l)+a(r)-max(a((l+r)/2),a(l),a(r))-min(a((l+r)/2),a(l),a(r))
    do
      do while (a(l).lt.p)
        l = l+1
      end do
      do while (a(r).gt.p)
        r = r-1
      end do
      if (l.ge.r) exit
      c = a(l)
      a(l) = a(r)
      a(r) = c
      l = l+1
      r = r-1
    end do
    if (l.gt.2) call quick_sort(a(1:l-1))
    if (n.gt.r+1) call quick_sort(a(r+1:n))
  end subroutine quick_sort
end program modulo_operations