#define _CRT_SECURE_NO_WARNINGS
#include <iostream>

#define MAX_N 200000

int arr[MAX_N];

int main()
{
	int n, k;
	scanf("%d%d", &n, &k);

	int sum = 0;	
	for (int i = 0; i < n; ++i)
	{
		scanf("%d", arr + i);
		sum += arr[i];
	}
	
	int r = sum;
	int max = INT_MIN;
	bool strana;
	int mi;

	for (int i = 0; i < n - 1; ++i)
	{		
		r -= 2 * arr[i];
		
		if (max < r)
		{
			mi = i;
			strana = true;
			max = r;
		}
		if (max < -r)
		{
			mi = i;
			strana = false;
			max = -r;
		}
	}
	

	printf("%d", max);

	return 0;
}