Caught me… A pretty quick way to see this and the title is using Fermat’s little theorem which states that k^(p-1) ~ 1 mod p for nonzero k. Using this we can write
3*10^5 ~ 3^6 ~ 1 mod 7
and
3*10^8 ~ 3*(-3)^8 ~ 3^9 ~ 16^9 ~ 2^36 ~ (212)3 ~ 1^3 ~ 1 mod 13