Special Permutations

Count permutations of a distinct integer array where every adjacent pair satisfies that one divides the other. Return the count modulo 10^9 + 7.

Examples
Input: [2,3,6]
Output: 2
Hints

Special Permutations

Count permutations of a distinct integer array where every adjacent pair satisfies that one divides the other. Return the count modulo 10^9 + 7.