How to derive this $$\vdash\forall y_1\dots\forall y_n B\to B$$?
Attempt
I tried to see for only one variable, that is $\vdash\forall y_1 B\to B$.
Proof: By hypothesis $\forall y_1 B$ and by A4 axiom I can have $\forall y_1 B\to B$. Using modus ponens in both formulas I have B.
When I tried to add another variable y$_2$ a question appear: $\forall(y_1y_2)\iff\forall y_1\forall y_2$?
If both are equivalent, then $\forall( y_1\dots y_n)B\to B$ by A4 and by hypothesis $\forall( y_1\dots y_n)B$. Using Modus ponens in both formulas I get B.
Am I correct ?
Note: A4 is the axiom 4, you can see them here:


First off, forget modus ponens for the single variable case. You are deducing from the empty set, so the proof of the single variable case $(\forall y_1) B \rightarrow B$ is just that it's an instance of A4.
It's not usually the case that $\forall(y_1 y_2)$ is even a valid thing to write down formally, although its intended meaning is clear. And its intended meaning is the same thing that $\forall y_1\forall y_2$ means. It seems like you're trying to group $y_1$ and $y_2$ into "one thing" and just apply your previous method to it, but I don't think that's the right thing to do formally.
Instead we can do it inductively. By A4, we can deduce $\forall y_1 B \rightarrow B$ and we can also apply A4 on the formula $\forall y_1 B$ to deduce $\forall y_2 \forall y_1 B \to \forall y_1 B.$ Then we can combine these two formulae to deduce $ \forall y_2\forall y_1 B\to B.$ It should be intuitively clear that this is valid, but I'll leave the details to you.