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 is empty then return "Yes".
  assert generate_toc("")=="Yes"
  assert generate_toc("Sample data")=="Yes"
  assert generate_toc("Invalid data")=="No"
  assert generate_toc("Missing data")=="No"
  assert generate_toc(" ")=="Yes"
output: def generate_toc(data):
      if not data or data.strip():
          return "Yes"
      else:
          return "No"