You should really think through the worst case scenarios of making a major investment like this with a friend.
While people love to assume that things are going to go well, what happens if you take out a mortgage on $700,000 now and then three years from now or five years from now either of you needs to get out of this? Think about it - this could happen for any number of reasons from one of you losing your job, one of you having to move away because of a job. And, if either of your personal situations change (family responsibilities, serious dating partner), this could happen as well.
For me, the worst case scenario to keep in mind is that any number of these things could happen to your friend - which would then put you in a very awkward situation. You would be in a position in which you would feel obligated to give a friend a huge break and let him "buy" himself out (probably for a fraction of what he actually owes). Or, you would feel pressured to sell the house quickly, which would almost certainly lead you to lose a lot of money.
Then - to make matters worse - you financed this with money from your 401k. So, now you are left with the remainder of a huge loan - with no real hope/prospects of getting back on track with your 401k.
I wouldn't do it. No way.....