func_code_string: #include <bits/stdc++.h>   using namespace std;   const int M = 1000000007;   int n;   int dp[1000010];   int main() {     while (~scanf( %d , &n)) {       int a = 0;       for (int i = 1; i <= n; i++) {         int x;         scanf( %d , &x);         if (x == 1) a++;       }       dp[0] = dp[1] = 1;       for (int i = 2; i <= a; i++)         dp[i] = (dp[i - 1] + (long long)dp[i - 2] * (i - 1)) % M;       int ans = dp[a];       for (int i = a + 1; i <= n; i++) ans = (long long)ans * i % M;       printf( %d n , ans);     }   }   