Yes, URL affects SEO. First of all, it is a direct ranking factor. This means Google analyses URLs to understand the context of the web page. Secondly, if you wish to change URL later, you cannot do that without compromising on SEO and direct traffic.