Jeff Bezos was quoted as saying that in the past, success was 30% product and 70% distribution, but now the numbers are reversed.
Engagement matters most. Engagement is actually a function of great product and great distribution. Engagement is thought-of mostly as a product issue but in many cases, it also expresses itself as a distribution problem particularly where there is no possibility for a "single player" experience (marketplaces, feedback loops, anything attempting to be inherently social)
If you have sustained engagement (a product experience loved by users) you will be successful, limited only by the potential number of people in the world that need the experience you provide and growing at a rate closely correlated to your distribution channels.
Inefficient distribution is easier to optimize for then insufficient product. So to this extent, product matters more. But available distribution channels (or more accurately, the unavailable distribution tactics) also can define a company's fundraising options, and more definitively, the overall cultural and corporate DNA of the organization that forms around product & distribution.
This is the best, most generalized answer I can provide to your question. Happy to talk to you and provide you a more contextually relevant answer to your own circumstances.
I appreciate Tom's response, and would love to wholeheartedly agree. That being said, I am simply going to take a divergent perspective for balance.
When a company starts, a good enough product is good enough when it allows for sales, which are dependent on distribution. Therefore, good distribution trumps good product at first; however, as you pointed out, the tables eventually turn.
Almost always, the promise of a product is enough to create a customer at startup, distribution allows for that customer to generate a sale.
Think about it this way: nobody ever needed a blanket with arms - there was no real compelling "job to be done" - but distribution created the hit with a just good enough product.
Remember when twitter was first released? It crashed constantly and hardly anyone worth following was present. But the system of distribution was a thing of beauty.
All else being equal, distribution creating sales buys runway for product development. So, I'm completely in agreement with Jeff Bezos on this one.
Before you can answer this question (and it is a question that you as the entrepreneur must answer for yourself), you need to decide if you are building a business or an application. I like to distinguish between organization-builders and feature-builders. Both are valuable, and entrepreneurs have different persuasions and motivations. I decided early on that I wanted to build a company (Plovgh, for the record, reconfigures agricultural marketing and distribution), in other words an organization that provided a product and service, rather than a piece of technology that could work wonders in a number of different contexts. I see company-building as choosing to play the long game in a given sector, whereas feature-building lends itself more to a quick acquisition.
If you decide you are a feature-builder, then go forth and do product like no one has done product before. Just make sure, as others have said, you get out into the world every chance you can to ensure you're building a product that human beings need and want. This goes for both B2B and B2C channels.
Now, you cannot build a company without product AND distribution. I suggest asking yourself, what is the easiest thing to hack? Is the problem I'm solving so entrenched that even an ugly, clumsy mock-up of a product could woo potential customers? In the case of Plovgh, the need among farmers to access their markets independent of brokers and middlemen was strong enough that we started with Google docs and Paypal buttons before we even wrote a line of code! Doing so taught us a great deal about what to build, but also established the seed of a userbase that we used as a stepping stone. We now take a step-wise approach to product and distribution, and the two elements get attention in a fairly synchronized way because with every improvement to product, we have another leg to stand on as we grow our userbase.
On the other hand, perhaps your personal network is an ideal target market for your product. Can you in a sense hack distribution by getting your better-than-basics product into the hands of lots of the right people right away? Maybe a simple way of thinking about this is, what is going to be easier for you and your team, given your skills, experience, contacts, and so on? If it's distribution, then invest more upfront in product; if it's product, then invest more upfront in distribution.
No matter what, don't pursue either in isolation.
Having watched companies build great distribution networks before creating demand, and having watched great products get iterated on to death before ever getting in front of a customer (and then finding out xyz feature isn't important, or critical abc feature is missing), I would say the right answer for YOU will emerge through a customer discovery process. I have yet to see a simpler, faster process for iterating on what your customers want and how to serve them best than Steve Blank's Business Model Canvas: http://www.youtube.com/watch?v=6t0t-CXPpyM.