Ah. Certainly you can leave a top row of headers. I'm assuming the formula now looks like this:
=IF(ROW()<=$B$2,$A$2,"")
Should that be correct, then you need to make an edit to the first part of the formula, which I have bolded and put in red. Let me ask you - what do you think you need to do to fix the formula?
=IF(ROW()<=$B$2,$A$2,"")