C# LINQ three-liner with precomputed primes
csharp\npublic class Solution\n{\n    private static HashSet<int> _primes = new HashSet<int> { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 6
```csharp\npublic class Solution\n{\n    private static HashSet<int> _primes = new HashSet<int> { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 };\n\n    public int NumPrimeArrangements(int n)\n    {\n        var primes = Enumerable.Range(1, n).Count(_primes.Contains);\n        return (int)Enumerable.Range(1, primes)\n            .Concat(Enumerable.Range(1, n - primes))\n            .Aggregate(1L, (a, n) => a * n % 1000000007);\n    }\n}\n```
[]