Farmer John's field is a (N−1)×(N−1) square. Its southwest corner is at (0,0) and its northeast corner is at (N−1,N−1). John wants to plant sweet corn in part of it.
At some integer coordinates there are double-headed sprinklers, and each one sprays both water and fertilizer. A sprinkler at (i,j) waters the part of the field north and east of itself, and fertilizes the part south and west of itself. Formally, it waters every real coordinate (x,y) with x≥i and y≥j, and it fertilizes every real coordinate (x,y) with x≤i and y≤j.
John picks an axis-aligned rectangle inside the field whose four corners all have integer coordinates, and plants sweet corn in it. For the corn to grow, every point of the rectangle must be both watered and fertilized. The rectangle must also have area greater than 0, or there is no room for corn.
Help John count the rectangles in which he could grow sweet corn. This number can be large, so report it modulo 109+7.