of breaking/ of having broken

The teacher accused the student of breaking the window.

Is it also possible to say it this way below

The teacher accused the student of having broken the window.

Thanks

Yes, you can say it both ways, but the first one is (fairly obviously) simpler.