There is a sequence of positive numbers \(a_1,a_2,a_3,...a_{m}\) such that \(a_1=19,a_2=98,a_m=0,\) and
\(a_{n+2}=a_n-\frac{2}{a_{n+1}},\) for \(n=1,2,...,m-2\).
Find the value of \(m\).
m = 782.