#include<bits/stdc++.h>
#pragma GCC optimize(2)
#define LL long long
using namespace std;
const int N=5005,M=205;
int n,m,x[M][N],h[M][N];
int b[M][N],st[N],w[N];
LL a[N],e[N][N],ans;
int main(){
	scanf("%d%d",&n,&m);
	for(int i=2;i<=n;i++)
		scanf("%lld",&a[i]),a[i]+=a[i-1];
	for(int i=1;i<=n;i++)
		for(int j=1;j<=m;j++)
			scanf("%d",&b[j][i]);
	for(int i=1,p,j;i<=m;i++){
		for(j=1,p=0;j<=n;j++){
			while(p&&w[p]<b[i][j])p--;
			x[i][j]=p?st[p]+1:1;
			st[++p]=j;w[p]=b[i][j];
		}
		for(j=n,p=0;j;j--){
			while(p&&w[p]<b[i][j])p--;
			h[i][j]=p?st[p]-1:n;
			st[++p]=j,w[p]=b[i][j];
		}
		for(j=1;j<=n;j++)
			e[x[i][j]][j]+=b[i][j],
			e[x[i][j]][h[i][j]+1]-=b[i][j],
			e[j+1][j]-=b[i][j],
			e[j+1][h[i][j]+1]+=b[i][j];
	}
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++)
			e[i][j]+=e[i][j-1];
		for(int j=1;j<=n;j++)
			e[i][j]+=e[i-1][j];
		for(int j=i;j<=n;j++)
			ans=max(ans,e[i][j]-a[j]+a[i]);
	}
	printf("%lld\n",ans);
	return 0;
}