import yaml
import json


def yaml_to_json(file_name):
    """Convert yaml file to json"""
    with open(file_name, "r", encoding="utf-8") as yaml_file:
        obj = yaml.load(yaml_file, Loader=yaml.FullLoader)
        return json.dumps(obj, indent=4) + "\n"