public static void main(String[] args) {         Scanner scanner = new Scanner(new BufferedReader(new InputStreamReader(System.in)));         int n = scanner.nextInt();         int[] count = new int[n], capacity = new int[n];         for (int i = 0; i < n; i++) {             count[i] = scanner.nextInt();         }         for (int i = 0; i < n; i++) {             capacity[i] = scanner.nextInt();         }         Arrays.sort(count);         Arrays.sort(capacity);         long res = 1;         int right = n - 1;         for (int i = n - 1; i >= 0; i--) {             while (right >= 0 && capacity[right] >= count[i])                 right--;             res *= (n - 1 - right) - (n - 1 - i);             res %= 100000007;             if (res == 0)                 break;         }         System.out.println(res);     }