signedmain(){ cin >> n; if (n == 1) { cout << 1; return0; } for (int i = 1; i <= n; i++) { cin >> a[i]; } sort(a + 1, a + n + 1); int last = 1, cnt = 1; for (int i = 2; i <= n; i++) { if (a[i] != last + 1) { last += 2; cnt += 1; } else { ans = ans * (cnt + 1) % 1000000007; } } for (int i = 1; i <= cnt; i++) { ans = ans * i % 1000000007; } cout << ans; }