Detect if the given code is a valid HTML code.
<html>
    <h1>This is a heading</h1>
    <p>This is a paragraph.</p>
</html>
Yes, the given code is a valid HTML code.
Complete the following task based on the instruction and optional input provided.### Instruction:
Detect if the given code is a valid HTML code.

### Input:
<html>
    <h1>This is a heading</h1>
    <p>This is a paragraph.</p>
</html>

### Output:
Yes, the given code is a valid HTML code.