<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_elements(elements):
 """Parse waypoint data elements. Args: elements (list):
 Data values for fix Returns: nmea.Waypoint: Object representing data """

        if not len(elements) == 5:
            raise ValueError('Invalid WPL waypoint data')
        # Latitude and longitude are checked for validity during Fix
        # instantiation
        latitude = parse_latitude(elements[0], elements[1])
        longitude = parse_longitude(elements[2], elements[3])
        name = elements[4]
        return Waypoint(latitude, longitude, name)