def find_actions(n, m, k, edges_original, edges_new):
    if m != k:
        return "NO"
    
    actions = []
    
    for edge in edges_new:
        if edge not in edges_original:
            actions.append(edge)
    
    if len(actions) == 0:
        return "NO"
    
    result = "YES\n"
    result += str(len(actions)) + "\n"
    
    for action in actions:
        result += " ".join(str(x) for x in action) + "\n"
    
    return result

# Пример использования функции
n, m, k = 3, 0, 3
edges_original = [(1, 2), (2, 3), (3, 1)]
edges_new = [(1, 2, 3)]

result = find_actions(n, m, k, edges_original, edges_new)
print(result)
