use proconio::input; fn main() { input! { n: usize, m: usize, } let mut dp = vec![0; n]; dp[0] = 0; dp[1] = 1; for i in 2..n { dp[i] = dp[i-1] + dp[i-2]; } let ans = dp[n-1] % m; println!("{}", ans); }