It'll work, but viability of the yeast is about half of what it would have been if you had rehydrated the yeast first. You'll get about half the amount of live yeast that you would have if you'd rehydrated.
From How to Brew by John Palmer:
Dry yeast should be re-hydrated in water before pitching. Often the concentration of sugars in wort is high enough that the yeast can not draw enough water across the cell membranes to restart their metabolism.
So, your beer will ferment, but next time I certainly would rehydrate first to ensure you're not underpitching.