<｜begin▁of▁sentence｜>### Instruction:
Given a graph with edge set [(1, 2), (1, 3), (3, 4), (4, 5)], can you use NetworkX to determine if there is a path between node 1 and node 5?
### Response:
import networkx as nx

# Create a graph
G = nx.Graph()
G.add_edges_from([(1, 2), (1, 3), (3, 4), (4, 5)])

# Use has_path to check if there is a path between node 1 and 5
path_exists = nx.has_path(G, source=1, target=5)

print('Is there a path between node 1 and 5?', path_exists)
<|EOT|>
