#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  long long n, q, x, y;
  cin >> n >> q;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  vector<long long> seen(20, n);
  vector<vector<long long>> left(n, vector<long long>(20, n));
  for (long long i = 0; i < 20; i++) {
    if (a[n - 1] & (1 << i)) {
      seen[i] = n - 1;
      left[n - 1][i] = n - 1;
    }
  }
  for (long long i = n - 2; i >= 0; i--) {
    for (long long j = 0; j < 20; j++) {
      if (a[i] & (1 << j)) {
        left[i][j] = i;
      } else {
        for (long long k = 0; k < 20; k++) {
          if (a[i] & (1 << k) && seen[k] < n)
            left[i][j] = min(left[i][j], left[seen[k]][j]);
        }
      }
    }
    for (long long j = 0; j < 20; j++)
      if (a[i] & (1 << j)) seen[j] = i;
  }
  while (q--) {
    cin >> x >> y;
    x--;
    y--;
    bool shi = false;
    for (long long i = 0; i < 20; i++)
      shi |= (a[y] & (1 << i) && left[x][i] <= y);
    shi ? cout << "Shi\n" : cout << "Fou\n";
  }
}
