def is_valid_file_mode(file_mode):
    """Return True if the given "file_mode" represents a valid file I/O mode"""
    return file_mode in {'r', 'w', 'rb', 'wb', 'a', 'ab', 'r+', 'rb+', 'w+',
        'wb+', 'a+', 'ab+'}
