Given `n` and `p`, write down a JavaScript function that computes n-th Fibonacci number mod p.