C# 2 Pointer solution
\npublic class Solution\n{\n    public int NumSubseq(int[] nums, int target)\n    {\n        Array.Sort(nums);\n        long mod = (long)Math.Pow(10, 9) + 7;\n\
```\npublic class Solution\n{\n    public int NumSubseq(int[] nums, int target)\n    {\n        Array.Sort(nums);\n        long mod = (long)Math.Pow(10, 9) + 7;\n\t\t//Pre compute 2^N, since N is big in this question.\n        long[] cnt = new long[nums.Length];\n        cnt[0] = 1;\n        for (int i = 1; i < nums.Length; i++)\n        {\n            cnt[i] = cnt[i - 1] * 2 % mod;\n        }\n        \n        long res = 0;\n        int left = 0;\n        int right = nums.Length - 1;\n        while (left <= right)\n        {\n            if (nums[left] + nums[right] > target)\n                right--;\n            else\n            {\n\t\t\t\t//The combination of sub sequence starting from nums[left] is 2 ^ (right - left)\n                res += cnt[right - left];\n                left++;\n            }\n        }\n\n        return (int)(res % mod);\n    }\n}\n```
[]