use std::{ collections::{BTreeSet, HashMap}, hash::Hash, }; fn main() { proconio::input! { n: usize, m: u32, } let mut fib = vec![0, 1]; for _ in 0..n - 2 { fib.push((fib[fib.len() - 1] + fib[fib.len() - 2]) % m); } //eprintln!("{fib:?}"); println!("{}", fib[fib.len() - 1]); }