#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 2;
int dp[N][21], ar[N], lis[21];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, i, j, k, l, q;
  cin >> n >> q;
  for (i = 1; i <= n; i++) {
    cin >> ar[i];
    for (j = 0; j <= 19; j++) {
      if (((1 << j) & ar[i])) {
        dp[i][j] = i;
        if (!lis[j]) {
          lis[j] = i;
        } else {
          for (k = 0; k <= 19; k++) {
            dp[i][k] = max(dp[i][k], dp[lis[j]][k]);
          }
          lis[j] = i;
        }
      }
    }
  }
  for (i = 1; i <= q; i++) {
    cin >> j >> k;
    for (l = 0; l <= 19; l++) {
      if (((1 << l) & ar[j])) {
        if (dp[k][l] >= j) {
          cout << "Shi\n";
          break;
        }
      }
      if (l == 19) {
        cout << "Fou\n";
      }
    }
  }
}
