Java Solution 100 %
\nclass Solution {\n    public int numPrimeArrangements(int n) {\n        if(n < 2){\n            return 1;\n        }\n        long res = 1;\n        int prime
```\nclass Solution {\n    public int numPrimeArrangements(int n) {\n        if(n < 2){\n            return 1;\n        }\n        long res = 1;\n        int prime = 1;\n        int notPrime = 1;\n        for(int i = 3; i <= n; i++){\n            if(isPrime(i)){\n                prime++;\n            }else{\n                notPrime++;\n            }\n        }\n        for(int i = prime; i > 0; i--){\n            res *= i;\n            res %= 1000000007;\n        }\n        for(int i = notPrime; i > 0; i--){\n            res *=i;\n            res %= 1000000007;\n        }\n        return (int)res; \n    }\n    public boolean isPrime(int num){\n        for(int i = 2; i <= num / 2; i++){\n            if(num % i == 0){\n                return false;\n            }\n        }\n        return true;\n    }\n}\n```
['Java']