Java Solution
\nclass Solution {\n    public int numSubseq(int[] nums, int target) {\n        Arrays.sort(nums);\n        int ans = 0;\n        int n = nums.length;\n        
```\nclass Solution {\n    public int numSubseq(int[] nums, int target) {\n        Arrays.sort(nums);\n        int ans = 0;\n        int n = nums.length;\n        int mod = (int)(1e9 + 7);\n        int[] pows = new int[n];\n        pows[0] = 1;\n        for (int i = 1; i < n; i++) {\n            pows[i] = (pows[i - 1] * 2) % mod;\n        }\n        int i = 0, j = n - 1;\n        while (i <= j) {\n            if (nums[i] + nums[j] <= target) {\n                ans = (ans + pows[j - i]) % mod;\n                i++;\n            } else {\n                j--;\n            }\n        }\n        return ans;\n    }\n}\n```
[]