def are_of_compatible_type(val1, val2) ->bool:
    """
    Check if types are compatibles
    :param val1: the first value
    :param val2: the second value
    :return: True if types are compatible
    """
    return (isinstance(val1, val2.__class__) or isinstance(val1, (float,
        int)) and isinstance(val2, (float, int))) and isinstance(val1, (
        bool, str, float, int))
