This problem asks: How many different routes are there from city 1 to city n in a flight network (DAG)?
The answer can be huge, so return it modulo 109+7. A route is a sequence of cities where you can fly from each city to the next. This is a path counting problem on a DAG.
Instead of taking min or max when relaxing edges, you add: dp[v] = dp[v] + dp[u] for each edge (u,v). Each path to u extends to a path to v.