import java.util.Scanner;

public class Main {

    private static int m_iTotalTaskDays;

    public static void main(String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);

        final int iVacationDay = Integer.parseInt(sc.next());
        final int iTaskNum = Integer.parseInt(sc.next());
        for (int i = 0; i < iTaskNum; i++) {
            final int iTaskDays = Integer.parseInt(sc.next());
            calcTotalTaskDays(iTaskDays);
        }
        int iResult = iVacationDay - m_iTotalTaskDays;
        if (0 > (iResult)) {
            iResult = -1;
        }
        System.out.print(iResult);
    }

    private static void calcTotalTaskDays(final int iTaskDays) {
        m_iTotalTaskDays += iTaskDays;
    }
}

/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz