Is it valid to put <header> and <footer> inside of <main>?

I ran a file through the validator with this code:

Code HTML4Strict:
<main>
     <header>
     </header>
      <div>
      </div>
      <footer>
      </footer>
</main>

and it passed, but all examples I've seen online so far make <header>, <main>, and <footer> siblings, as in

Code HTML4Strict:
<somewrapper>
     <header>
     </header>
      <main>
      </main>
      <footer>
      </footer>
</somewrapper>