Convert a list of dates to a specific format.
Implement convert_dates(dates) to convert each date from M/D/YYYY or MM/DD/YYYY into YYYY-MM-DD, preserving the input order. The input is an array of valid date strings, and the output is an array of normalized strings. For example, 3/7/2024 becomes 2024-03-07, while 12/25/2025 becomes 2025-12-25.
def convert_dates(dates):