input: Write a function to determine if it is possible to create a HTML page that displays a table of contents from the data stored in a database. If it is possible, return "Yes" else return "No". If the input data is missing or incorrect, return "Invalid input".
  assert display_table_of_contents(valid_data)== "Yes"
  assert display_table_of_contents(invalid_data)== "Invalid input"
  assert display_table_of_contents(None)== "Invalid input"
output: def display_table_of_contents(data):
      if data is None or not isinstance(data, dict):
          return "Invalid input"
      return "Yes"