Let the no. of sides of the polygon be $n$

The sum of the interior angles of $n$ sided polygon = $(n-2).180^{\circ}$

It is given that the difference between any two consecutive angles is $5^{\circ}$

$\therefore$ The angles of the polygon are assumed as

$a,a+5,a+10,...........a+(n-1).5$

We know that the the sum of the angles =$ (n-2).180$

$\Rightarrow\:a+(a+5)+(a+10)+...........a+(n-1).5=(n-2).180$

This series is an A.P. with common difference $d=5$

We know that the sum of $n$ terms of an A.P=$\large\frac{n}{2}$$[2a+(n-1)d]$

$\Rightarrow\:\large\frac{n}{2}$$[2a+(n-1)5]=(n-2)180$

Also given that the smallest angle is $120^{\circ}$

$\therefore\:a=120$

$\Rightarrow\:\large\frac{n}{2}$$[2\times 120+(n-1)5]=(n-2)180$

$\Rightarrow\:n[240+5n-5]=(n-2).360$

$\Rightarrow\:5n^2+235n=360n-720$

$\Rightarrow\:5n^2-125n+720=0$

Taking $5$ common

$\Rightarrow\:n^2-25n+144=0$

$\Rightarrow\:n^2-16n-9n+144=0$

$\Rightarrow\:n(n-16)-9(n-16)=0$

$\Rightarrow\:(n-16)(n-9)=0$

$\Rightarrow\:n=16\:\:or\:\:n=9$