#include <cstdio>
#include <algorithm>
using namespace std;
#define dmax(_a, _b) ((_a) > (_b) ? (_a) : (_b))
#define cmax(_a, _b) (_a < (_b) ? _a = (_b) : 0)
struct Event{
	int x, l, r, val;
	inline bool operator <(const Event &e) const {
		return x == e.x ? val < e.val : x < e.x;
	}
}ev[2000007];
long long s[100008], t[262202], tag[262202], nowmax;
int pos, val, lbd, rbd, evn;
void Build(register int o, register int l, register int r){
	if (l == r) {
		t[o] = -s[l];
		return ;
	}
	register int o2 = o << 1, mid = l + r >> 1;
	Build(o2, l, mid);
	Build(o2 | 1, mid + 1, r);
	t[o] = dmax(t[o2], t[o2 | 1]);
	return ;
}
#define Pushdown(_oo, _oo2) {\
	t[_oo2] += tag[_oo]; \
	t[_oo2 | 1] += tag[_oo]; \
	tag[_oo2] += tag[_oo]; \
	tag[_oo2 | 1] += tag[_oo]; \
	tag[_oo] = 0; \
}
void Modify(register int o, register int l, register int r){
	//if (val == 3) fprintf(stdout, "%d [%d %d] %d %lld %lld\n", o, l, r, val, t[o], tag[o]);
	if (lbd <= l && r <= rbd) {
		t[o] += val;
		tag[o] += val;
	//if (val == 3) fprintf(stdout, "%d %d %d %d %lld %lld\n", o, l, r, val, t[o], tag[o]);
		return ;
	}
	register int o2 = o << 1, mid = l + r >> 1;
	if (tag[o]) Pushdown(o, o2);
	if (lbd <= mid) Modify(o2, l, mid);
	if (mid < rbd) Modify(o2 | 1, mid + 1, r);
	t[o] = dmax(t[o2], t[o2 | 1]);
	//if (val == 3) fprintf(stdout, "%d %d %d %d %lld\n", o, l, r, val, t[o], tag[o]);
	return ;
}
void Query(register int o, register int l, register int r){
	if (lbd <= l && r <= rbd) {
		//fprintf(stderr, "%d %d %d %lld %lld\n", o, l, r, t[o], tag[o]);
		cmax(nowmax, t[o]);
		return ;
	}
	register int o2 = o << 1, mid = l + r >> 1;
	if (tag[o]) Pushdown(o, o2);
	if (lbd <= mid) Query(o2, l, mid);
	if (mid < rbd) Query(o2 | 1, mid + 1, r);
	return ;
}
#undef Pushdown
int b[1000008], stk[100008], covl[100008];
int fastin(){
	register int i; register char ch;
	while (ch = getchar(), ch < '0' || ch > '9');
	i = ch - '0';
	while (ch = getchar(), ch >= '0' && ch <= '9') i = i * 10 + ch - '0';
	return i;
}
int main(){
	register int n, m, i, j, top, tmp, *B;
	register long long ans;
	n = fastin(), m = fastin();
	for (i = 2; i <= n; ++i) s[i] = s[i - 1] + fastin();
	for (i = 1; i <= n; ++i) for (j = 1; j <= m; ++j) b[(j - 1) * n + i] = fastin();
	for (i = 1; i <= m; ++i) {
		top = 0;
		B = b + (i - 1) * n;
		for (j = 1; j <= n; ++j) {
			while (top && B[tmp = stk[top]] < B[j]) {
				ev[++evn] = (Event){covl[top], tmp, j - 1, B[tmp]};
				ev[++evn] = (Event){tmp + 1, tmp, j - 1, -B[tmp]};
				--top;
			}
			stk[++top] = j;
			covl[top] = stk[top - 1] + 1;
		}
		while (top) {
			tmp = stk[top];
			ev[++evn] = (Event){covl[top], tmp, n, B[tmp]};
			ev[++evn] = (Event){tmp + 1, tmp, n, -B[tmp]};
			--top;
		}
	}
	//for (j = 1; j <= evn; ++j) fprintf(stderr, "#%d: %d %d %d %d\n", j, ev[j].x, ev[j].l, ev[j].r, ev[j].val);
	
	Build(1, 1, n);
	sort(ev + 1, ev + evn + 1);
	ans = 0;
	//lbd = 1;rbd = n;
	//	nowmax = -0x3f3f3f3f3f3f3f3fll;
	//	Query(1, 1, n);
	//	fprintf(stderr, "%lld\n", nowmax);
	for (i = j = 1; i <= n; ++i) {
		while (j <= evn && ev[j].x == i) {
			lbd = ev[j].l;
			rbd = ev[j].r;
			val = ev[j].val;
			Modify(1, 1, n);
			//if (i == 1) fprintf(stderr, "%d %lld %d\n", j, t[1], ev[j].val);
			++j;
		}
		lbd = i;
		rbd = n;
		nowmax = -0x3f3f3f3f3f3f3f3fll;
		Query(1, 1, n);
		cmax(ans, nowmax + s[i]);
		//fprintf(stderr, "%d %lld %lld\n", i, nowmax, s[i]);
	}
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 40192