Given a sequence of numbers, find if the sequence is a magic sequence or not.
A sequence is said to be a magic sequence if it is able to satisfy the condition that the number is the sum of preceding to numbers and follows the pattern till the end.
Examples
123 -> yes 1+2 = 3
1231518 -> yes 12+ 3 = 15 , 3+ 15 = 18
12314374 -> yes 12+31 =43 , 31+43 = 74
1231124125 -> yes 123+ 1 = 124, 1+ 124=125
1237 -> no 1+2=3, 2+3 != 7
456515727 -> no 45+6=51, 6+51=57, 52+57 != 27