from datetime import datetime


def check(str1, str2, format_str):
    """Check if two strings are equal (based on format), or both are redacted."""
    try:
        str1_conv = datetime.strptime(str1, format_str)
        str2_conv = datetime.strptime(str2, format_str)
        if str1_conv == str2_conv:
            return True
        else:
            return False
    except ValueError:
        if str1 == str2:
            return True  # both are redacted the same way, assume correct.
        else:
            return False