Police charge man snuck into Frederick School with a gun