class MathUtils {

  public static BigInteger sum(List<BigInteger> summands, BigInteger modulus) {
    return summands.stream()
        .reduce(BigInteger::add)
        .orElse(BigInteger.ZERO)
        .mod(modulus);
  }

  private  MathUtils();

}