Let's consider a graph with N vertices and No edges,thus degree of each vertex is 0.Now we will fill edges one by one in graph ,but first understand that "introducing an edge will increment degree of two vertices(between which this edge is connected) by 1-1 each".
If we implement this condition to present case where degree of all vertices is 0,we will have two vertices of degree 1-1 each with an introduction to single edge.
So when no of edge is 1->sum of degree of vert. is 2.
when no edges are e ->sum of degree of vert. will become 2*e .