J, 3232 30 bytes
4=5 12 17+/@e.~[:+/\0,~1+0=7|]
-2 thanks to xash
original explanation
[:(5&e.*12&e.*17={:)[:+/\1+0=7|]
Straightforward:
- Take list of digits
7|]
mod 70=
equals 0 (returns 1-0 list)1+
add 1 (now list of 1-2)[:+/\
scan sum[:(5&e.*12&e.*17={:)
is 5 an elm and is 12 an elm and is 17 the last?