<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_ymal_data(data):
 """Get metadata and validate them :param data: metadata in yaml format """

    try:
        format_data = yaml.load(data)
    except yaml.YAMLError, e:
        msg = "Yaml format error: {}".format(
            unicode(str(e), "utf-8")
        )
        logging.error(msg)
        sys.exit(1)

    if not check_config(format_data):
        sys.exit(1)

    return format_data