#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn=5100;
const int maxm=210;
int l[maxm][maxn];
int r[maxm][maxn];
int b[maxm][maxn];
int n,m;
int z[maxn];
int w[maxn];
int top=0;
ll a[maxn];
ll sum[maxn][maxn];
inline void init()
{
  scanf("%d%d",&n,&m);
  for(int i=2;i<=n;i++)
    scanf("%d",&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]);
}
inline void pre_()
{
  for(int i=1;i<=m;i++)
  {
    top=0;
    for(int j=1;j<=n;j++)
    {
	  while(top&&w[top]<b[i][j])
	    top--;
	  l[i][j]=top ? z[top]+1 : 1;
	  z[++top]=j;
	  w[top]=b[i][j];
	}
	top=0;
	for(int j=n;j>=1;j--)
	{
	   while(top&&w[top]<b[i][j])
	     top--;
	  r[i][j]=top ? z[top]-1 : n;
	  z[++top]=j;
	  w[top]=b[i][j];
	}
	for(int j=1;j<=n;j++)
	{
	  sum[l[i][j]][j]+=b[i][j];
	  sum[l[i][j]][r[i][j]+1]-=b[i][j];
	  sum[j+1][j]-=b[i][j];
	  sum[j+1][r[i][j]+1]+=b[i][j];
	}
  }
}
inline void work_()
{
  ll ans=0;
  for(int i=1;i<=n;i++)
  {
    for(int j=1;j<=n;j++)
      sum[i][j]+=sum[i][j-1];
    for(int j=1;j<=n;j++)
      sum[i][j]+=sum[i-1][j];
    for(int j=i;j<=n;j++)
      ans=max(ans,sum[i][j]-a[j]+a[i]);
  }
  printf("%lld\n",ans);
}
int main()
{
	//freopen(".in", "r", stdin);
	//freopen(".out", "w", stdout);
	init();
	pre_();
	work_();
	return 0;
}
