Create check sum in a tree

Check if there exists a path in a tree which sums to a given sum