program main
  implicit none
  integer(16) dp(0:300,0:300),a(0:300,0:300)
  integer(16) N
  integer(16) r,ret,i,j,k
  integer(16) pw(0:300)
  integer(16)::mo=1000000007
  read*,N
  pw(0)=1_16
  do i=1,n+1
    pw(i)=mod(pw(i-1)*2_16,mo)
  end do
  dp=0_16
  dp(0,0)=1_16
  do j=0,n-1 
    do k=0,j
  	  dp(j+1,k+1)=mod(dp(j+1,k+1)+mod(dp(j,k)*(pw(n)-pw(k)),mo),mo)
  	  dp(j+1,k)=mod(dp(j+1,k)+mod(dp(j,k)*pw(k),mo),mo)
	end do
  end do
  a=0
  do i=0,n-1
    read*,a(i,0:N-1)
  end do
  r=gauss(a,N)
  ret=0
  do i= r,n
    ret=mod(ret+mod(dp(n,i)*dp(i,r),mo)*powmod(2_16,n*n-i*n,mo),mo)
  end do
  ret=mod(ret*powmod(dp(n,r),mo-2_16,mo),mo)
  
  print"(i0)",ret
  
contains
function powmod(aa,b,mo)
  implicit none
  integer(16) aa,b,mo,ak,bk
  integer(16) powmod
  powmod=1_16
  bk=b
  ak=mod(aa,mo)
  do while(bk/=0_16)
    if(mod(bk,2)==1)then
      powmod=mod(powmod*ak,mo)
    endif
    ak=mod(ak*ak,mo)
    bk=bk/2_16
  end do
end function

function gauss(a,N)
  implicit none
  integer(16) N,a(0:300,0:300)
  integer(16) gauss
  integer(16) p,i,j,k
  integer(16) fg
  p=0
  do i=0,n-1
	fg=0
	do j=p,n-1 
      if (a(j,i)>0)then	
        do k=0,n-1 
          call swap(a(p,k),a(j,k))
        end do
        fg=1
		exit
      endif
    end do
	if (fg==0) cycle
    do j=p+1,n-1 
      if (a(j,i)>0)then
	    do k=0,n-1 
          a(j,k) = xor(a(j,k),a(p,k))
        end do
	  endif
    end do
	p=p+1
  end do
  gauss=p
end function

subroutine swap(a,b)
  implicit none
  integer(16) a,b
  a=xor(a,b)
  b=xor(a,b)
  a=xor(a,b)
end subroutine
end