#include #define MOD 1000000007LL using namespace std; typedef long long ll; typedef pair P; ll n; int m; int a[31][31]; int dp[31][31][31]; int dp2[31][31]; int main(void){ scanf("%lld%d",&n,&m); for(int i=0;i