In your first example, "the" sounds better. However, you couldn't really say "a" was wrong; it just doesn't sound as fluid. The your second example, putting "the" in, or not, tends to mean something slightly different.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.