#include <stdio.h>
#include <stdlib.h>
#include <math.h>



int main(void){
	int N=0;
	int M=0;
	scanf("%d",&N);
	scanf("%d",&M);
	int arr[M];
	for (int i = 0; i < M; ++i){
		arr[i]=0;
	}
	int total=0;	
	for (int i = 0; i < M; ++i){
		total=total + arr[i];
	}

	int result = N-total;
	if (result<0){
		result = -1;
	}
	printf("%d\n",result);

	return 0;

}