Both sentences in your question mean the same thing. Both are grammatically correct and, unfortunately, idiomatic.
I say "unfortunately", because contemporary native speakers of English often prefer the second style, which is unnecessarily (and pointlessly) verbose, and because they will also use the now-skunked word "enhances" to mean "improves" or "increases" when it really (IMHO) should be used only to mean "adds {value/flexibility} to".
Only context can allow an answer to the question "Can a gerund phrase be used interchangeably with other nouns?" Although it's common to believe that any noun phrase can fit into a blank labeled "noun phrase" in a fill-in-the-blank type of English test, the meanings of the noun phrases in question have to be considered. In this case, yes. In another case? Who knows? Give us specific pairs to look at.
Generally, the answer is probably "Probably". As FumbleFingers says in his comment, "It's entirely a stylistic choice in this example."