<｜begin▁of▁sentence｜>### Instruction:
Given a degree sequence [2, 2, 2, 1, 1], can you determine if this sequence can be realized by a simple graph using the Havel-Hakimi algorithm implemented in NetworkX?
### Response:
import networkx as nx

# Given degree sequence
deg_sequence = [2, 2, 2, 1, 1]

# Check if the degree sequence can be realized by a simple graph
valid = nx.is_valid_degree_sequence_havel_hakimi(deg_sequence)

print('Is the degree sequence valid?', valid)
<|EOT|>
