(define (fib n m) (define (fib-iter a b p q count) (cond ((zero? count) (modulo b m)) ((even? count) (fib-iter a b (modulo (+ (* p p) (* q q)) m) (modulo (+ (* 2 p q) (* q q)) m) (quotient count 2))) (else (fib-iter (modulo (+ (* b q) (* a q) (* a p)) m) (modulo (+ (* b p) (* a q)) m) p q (- count 1))))) (fib-iter 1 0 0 1 n)) (define yuki526 (display (fib (- (read) 1) (read))))