simple cpp solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    long long fact(int n)\n    {\n        if(n<=1)return 1;\n        return (n*fact(n-1)%1000000007)%1000000007;\n    }\n    int numPrimeArrangements(int n) {\n        if(n==1)return 1;\n        if(n<=3)return n-1;\n        int t=0,flag;\n        for(int i=2;i<=n;i++)\n        {\n            flag=0;\n            for(int j=2;j<=sqrt(i);j++)\n            {\n                if(i%j==0)\n                {\n                    flag=1;\n                    break;\n                }\n            }\n            if(flag==0)\n            {\n                t++;\n            }\n        }\n        return (fact(t)*fact(n-t))%1000000007;\n\n    }\n};\n```
['C++']