def isnormal(s: str) ->bool:
    """cheap algorithm to detect strings for which escape is an identity"""
    depth = 0
    for part in s.split('{'):
        if depth == 1 and part.startswith('}'):
            return False
        depth -= part.count('}')
        if depth < 0:
            return False
        depth += 1
    return depth == 1
