public static function canFactorsInImplicitMultiplication($token1, $token2)
    {
        if ($token1 === null || $token2 === null) return false;

        $check1 = (
            $token1->type == TokenType::PosInt ||
            $token1->type == TokenType::Integer ||
            $token1->type == TokenType::RealNumber ||
            $token1->type == TokenType::Constant ||
            $token1->type == TokenType::Identifier ||
            $token1->type == TokenType::FunctionName ||
            $token1->type == TokenType::CloseParenthesis ||
            $token1->type == TokenType::FactorialOperator ||
            $token1->type == TokenType::SemiFactorialOperator
        );

        if (!$check1) return false;

        $check2 = (
            $token2->type == TokenType::PosInt ||
            $token2->type == TokenType::Integer ||
            $token2->type == TokenType::RealNumber ||
            $token2->type == TokenType::Constant ||
            $token2->type == TokenType::Identifier ||
            $token2->type == TokenType::FunctionName ||
            $token2->type == TokenType::OpenParenthesis
        );

        if (!$check2) return false;

        if ($token1->type == TokenType::FunctionName && $token2->type == TokenType::OpenParenthesis)
            return false;

        return true;
    }