(define (fast-fibo i m) (define (helper n) (if (zero? n) (cons 0 1) (let* ( (result (helper (quotient n 2))) (a (car result)) (b (cdr result)) ) (if (even? n) (cons (modulo (* a (- (* 2 b) a)) m) (modulo (+ (* a a) (* b b)) m)) (cons (modulo (+ (* a a) (* b b)) m) (modulo (* b (+ (* 2 a) b)) m)) ) ) ) ) (car (helper i)) ) (define yuki526 (display (fast-fibo (- (read) 1) (read))))