setTimeout and setInterval time management

I want to create a function that prints ‘Hello, World!’ every second for 5 minutes, and after 5 minutes, this function will stop for 1 minute. I want to create a loop like this with setTimeout and setInterval, but I couldn’t. Can anyone help me?

const helloWorld = () => console.log("Hello, World!")

const stopSayHello = () => console.log("Stopped for a minute!")

The HelloWorld function will run every second for 5 minutes. After 5 minutes, the stopSayHello function will run for a minute. Then, this loop will continue.