code: def test_factorial_Mod():
      pr = Symbol("pr", prime=True)
      p, q = 10**9 + 9, 10**9 + 33  # prime modulo
      r, s = 10**7 + 5, 33333333  # composite modulo
      assert Mod(factorial(pr - 1), pr) == pr - 1
      assert Mod(factorial(pr - 1), -pr) == -1
      assert Mod(factorial(r - 1, evaluate=False), r) == 0
      assert Mod(factorial(s - 1, evaluate=False), s) == 0
      assert Mod(factorial(p - 1, evaluate=False), p) == p - 1
      assert Mod(factorial(q - 1, evaluate=False), q) == q - 1
      assert Mod(factorial(p - 50, evaluate=False), p) == 854928834
      assert Mod(factorial(q - 1800, evaluate=False), q) == 905504050
      assert Mod(factorial(153, evaluate=False), r) == Mod(
          factorial(153), r
      )
      assert Mod(factorial(255, evaluate=False), s) == Mod(
          factorial(255), s
      )
      assert Mod(factorial(4, evaluate=False), 3) == S.Zero
      assert Mod(factorial(5, evaluate=False), 6) == S.Zero
  
imports: from sympy.concrete.products import Product
  from sympy.core.function import expand_func
  from sympy.core.mod import Mod
  from sympy.core.mul import Mul
  from sympy.core import EulerGamma
  from sympy.core.numbers import Float, I, Rational, nan, oo, pi, zoo
  from sympy.core.relational import Eq
  from sympy.core.singleton import S
  from sympy.core.symbol import Dummy, Symbol, symbols
  from sympy.functions.combinatorial.factorials import ff, rf, binomial, factorial, factorial2
  from sympy.functions.elementary.miscellaneous import sqrt
  from sympy.functions.elementary.piecewise import Piecewise
  from sympy.functions.special.gamma_functions import gamma, polygamma
  from sympy.polys.polytools import Poly
  from sympy.series.order import O
  from sympy.simplify.simplify import simplify
  from sympy.core.expr import unchanged
  from sympy.core.function import ArgumentIndexError
  from sympy.functions.combinatorial.factorials import subfactorial
  from sympy.functions.special.gamma_functions import uppergamma
  from sympy.testing.pytest import XFAIL, raises, slow
label_desc: Use image node_id 6 for calling a global function with example usage: test_factorial_Mod() without return types