100% faster than other C++ solutions
\nclass Solution {\npublic:\n    bool isPrime(int n){\n        if(n==1){\n            return false;\n        }\n        for(int i=2;i<n;i++){\n            if(n%
```\nclass Solution {\npublic:\n    bool isPrime(int n){\n        if(n==1){\n            return false;\n        }\n        for(int i=2;i<n;i++){\n            if(n%i==0){\n                return false;\n            }\n        }\n        return true;\n    }\n    int Factorial(int n){\n        long int f=1;\n        while(n>0){\n            f=(f*n)%1000000007;\n            n--;\n        }\n        return f;\n    }\n    int numPrimeArrangements(int n) {\n        int p=0;\n        for(int i=2;i<=n;i++){\n            if(isPrime(i)){\n                p++;\n            }\n        }\n        long int a = Factorial(p);\n        long int b = Factorial(n-p);\n        return (a*b)%1000000007;\n    }\n};\n```
['C']