H,W=map(int,input().split()) sx,sy=map(int,input().split()) gx,gy=map(int,input().split()) sx-=1 sy-=1 gx-=1 gy-=1 def dfs(px,py): global a if (px,py)==(gx,gy): a+=1 else: for dx,dy in [(1,0),(0,1),(-1,0),(0,-1)]: tx,ty=px+dx,py+dy if 0<=tx